mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-25 08:46:10 -06:00
Add feature query for bookmarks
This commit is contained in:
parent
029dc8e1bf
commit
5f5ac03f68
@ -198,7 +198,7 @@ class SavedFilterSerializer(ValidatedModelSerializer):
|
||||
class BookmarkSerializer(ValidatedModelSerializer):
|
||||
url = serializers.HyperlinkedIdentityField(view_name='extras-api:bookmark-detail')
|
||||
object_type = ContentTypeField(
|
||||
queryset=ContentType.objects.all()
|
||||
queryset=ContentType.objects.filter(FeatureQuery('bookmarks').get_query()),
|
||||
)
|
||||
object = serializers.SerializerMethodField(read_only=True)
|
||||
user = NestedUserSerializer()
|
||||
|
@ -173,7 +173,7 @@ class SavedFilterForm(BootstrapMixin, forms.ModelForm):
|
||||
class BookmarkForm(BootstrapMixin, forms.ModelForm):
|
||||
object_type = ContentTypeChoiceField(
|
||||
queryset=ContentType.objects.all(),
|
||||
# limit_choices_to=FeatureQuery('bookmarks').get_query()
|
||||
limit_choices_to=FeatureQuery('bookmarks').get_query()
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
@ -495,6 +495,7 @@ class SyncedDataMixin(models.Model):
|
||||
|
||||
|
||||
FEATURES_MAP = {
|
||||
'bookmarks': BookmarksMixin,
|
||||
'custom_fields': CustomFieldsMixin,
|
||||
'custom_links': CustomLinksMixin,
|
||||
'export_templates': ExportTemplatesMixin,
|
||||
|
Loading…
Reference in New Issue
Block a user