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

Closes #2674: Enable filtering changelog by object type under web UI

This commit is contained in:
Jeremy Stretch
2018-12-13 14:35:26 -05:00
parent 0d3b1bfca4
commit a6c8c615eb
2 changed files with 9 additions and 2 deletions

View File

@ -3,6 +3,7 @@ v2.5.1 (FUTURE)
## Enhancements ## Enhancements
* [#2655](https://github.com/digitalocean/netbox/issues/2655) - Add 128GFC Fibrechannel interface type * [#2655](https://github.com/digitalocean/netbox/issues/2655) - Add 128GFC Fibrechannel interface type
* [#2674](https://github.com/digitalocean/netbox/issues/2674) - Enable filtering changelog by object type under web UI
## Bug Fixes ## Bug Fixes

View File

@ -11,7 +11,7 @@ from taggit.models import Tag
from dcim.models import DeviceRole, Platform, Region, Site from dcim.models import DeviceRole, Platform, Region, Site
from tenancy.models import Tenant, TenantGroup from tenancy.models import Tenant, TenantGroup
from utilities.forms import ( from utilities.forms import (
add_blank_choice, BootstrapMixin, BulkEditForm, BulkEditNullBooleanSelect, FilterChoiceField, add_blank_choice, BootstrapMixin, BulkEditForm, BulkEditNullBooleanSelect, ContentTypeSelect, FilterChoiceField,
FilterTreeNodeMultipleChoiceField, LaxURLField, JSONField, SlugField, FilterTreeNodeMultipleChoiceField, LaxURLField, JSONField, SlugField,
) )
from .constants import ( from .constants import (
@ -307,7 +307,7 @@ class ImageAttachmentForm(BootstrapMixin, forms.ModelForm):
# Change logging # Change logging
# #
class ObjectChangeFilterForm(BootstrapMixin, CustomFieldFilterForm): class ObjectChangeFilterForm(BootstrapMixin, forms.Form):
model = ObjectChange model = ObjectChange
q = forms.CharField( q = forms.CharField(
required=False, required=False,
@ -336,3 +336,9 @@ class ObjectChangeFilterForm(BootstrapMixin, CustomFieldFilterForm):
queryset=User.objects.order_by('username'), queryset=User.objects.order_by('username'),
required=False required=False
) )
changed_object_type = forms.ModelChoiceField(
queryset=ContentType.objects.order_by('model'),
required=False,
widget=ContentTypeSelect(),
label='Object Type'
)