We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1886258 commit 10e7659Copy full SHA for 10e7659
netbox/utilities/forms/fields/fields.py
@@ -1,6 +1,7 @@
1
import json
2
3
from django import forms
4
+from django.conf import settings
5
from django.db.models import Count
6
from django.forms.fields import JSONField as _JSONField, InvalidJSONInput
7
from django.templatetags.static import static
@@ -74,7 +75,8 @@ def get_choices():
74
75
count=Count('extras_taggeditem_items')
76
).order_by('name')
77
return [
- (str(tag.slug), '{} ({})'.format(tag.name, tag.count)) for tag in tags
78
+ (settings.FILTERS_NULL_CHOICE_VALUE, settings.FILTERS_NULL_CHOICE_LABEL), # "None" option
79
+ *[(str(tag.slug), f'{tag.name} ({tag.count})') for tag in tags]
80
]
81
82
# Choices are fetched each time the form is initialized
0 commit comments