feat(tags): Add object types field to Tag import form

Introduces the `object_types` field in the Tag bulk import form, allowing
assignment of one or more object types to Tags.
This commit is contained in:
Martin Hauser 2025-06-04 07:07:41 +02:00
parent ecb8656723
commit 0c15d7a1a9
No known key found for this signature in database

View File

@ -238,10 +238,18 @@ class TagImportForm(CSVModelForm):
label=_('Weight'), label=_('Weight'),
required=False required=False
) )
object_types = CSVMultipleContentTypeField(
label=_('Object types'),
queryset=ObjectType.objects.with_feature('tags'),
help_text=_("One or more assigned object types"),
required=False,
)
class Meta: class Meta:
model = Tag model = Tag
fields = ('name', 'slug', 'color', 'weight', 'description') fields = (
'name', 'slug', 'color', 'weight', 'description', 'object_types',
)
class JournalEntryImportForm(NetBoxModelImportForm): class JournalEntryImportForm(NetBoxModelImportForm):