1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #981: Allow filtering primary objects by a given set of IDs

This commit is contained in:
Jeremy Stretch
2017-03-22 09:39:30 -04:00
parent 1682de59df
commit 05b71564d8
6 changed files with 30 additions and 4 deletions

View File

@@ -6,6 +6,17 @@ from django.db.models import Q
from django.utils.encoding import force_text
#
# Filters
#
class NumericInFilter(django_filters.BaseInFilter, django_filters.NumberFilter):
"""
Filters for a set of numeric values. Example: id__in=100,200,300
"""
pass
class NullableModelMultipleChoiceField(forms.ModelMultipleChoiceField):
"""
This field operates like a normal ModelMultipleChoiceField except that it allows for one additional choice which is