Skip to content

Commit

Permalink
add role_filter to selector import form
Browse files Browse the repository at this point in the history
  • Loading branch information
amyasnikov committed Jan 23, 2025
1 parent a1fe49d commit fdf8809
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion validity/forms/bulk_import.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from core.models import DataFile, DataSource
from dcim.choices import DeviceStatusChoices
from dcim.models import DeviceType, Location, Manufacturer, Platform, Site
from dcim.models import DeviceRole, DeviceType, Location, Manufacturer, Platform, Site
from django.forms import Form
from django.utils.translation import gettext_lazy as _
from extras.models import Tag
Expand Down Expand Up @@ -122,6 +122,12 @@ class ComplianceSelectorImportForm(NetBoxModelImportForm):
help_text=_("Device Type slugs separated by commas, encased with double quotes"),
required=False,
)
role_filter = CSVModelMultipleChoiceField(
queryset=DeviceRole.objects.all(),
to_field_name="slug",
help_text=_("Device Role slugs separated by commas, encased with double quotes"),
required=False,
)
platform_filter = CSVModelMultipleChoiceField(
queryset=Platform.objects.all(),
to_field_name="slug",
Expand Down Expand Up @@ -160,6 +166,7 @@ class Meta:
"tag_filter",
"manufacturer_filter",
"type_filter",
"role_filter",
"platform_filter",
"status_filter",
"location_filter",
Expand Down

0 comments on commit fdf8809

Please sign in to comment.