mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Remove brief_mode parameter from DynamicModelChoiceMixin
This commit is contained in:
@ -271,20 +271,18 @@ class DynamicModelChoiceMixin:
|
||||
:param null_option: The string used to represent a null selection (if any)
|
||||
:param disabled_indicator: The name of the field which, if populated, will disable selection of the
|
||||
choice (optional)
|
||||
:param brief_mode: Use the "brief" format (?brief=true) when making API requests (default)
|
||||
"""
|
||||
filter = django_filters.ModelChoiceFilter
|
||||
widget = widgets.APISelect
|
||||
|
||||
# TODO: Remove display_field in v2.12
|
||||
def __init__(self, display_field='display', query_params=None, initial_params=None, null_option=None,
|
||||
disabled_indicator=None, brief_mode=True, *args, **kwargs):
|
||||
disabled_indicator=None, *args, **kwargs):
|
||||
self.display_field = display_field
|
||||
self.query_params = query_params or {}
|
||||
self.initial_params = initial_params or {}
|
||||
self.null_option = null_option
|
||||
self.disabled_indicator = disabled_indicator
|
||||
self.brief_mode = brief_mode
|
||||
|
||||
# to_field_name is set by ModelChoiceField.__init__(), but we need to set it early for reference
|
||||
# by widget_attrs()
|
||||
@ -309,10 +307,6 @@ class DynamicModelChoiceMixin:
|
||||
if self.disabled_indicator is not None:
|
||||
attrs['disabled-indicator'] = self.disabled_indicator
|
||||
|
||||
# Toggle brief mode
|
||||
if not self.brief_mode:
|
||||
attrs['data-full'] = 'true'
|
||||
|
||||
# Attach any static query parameters
|
||||
for key, value in self.query_params.items():
|
||||
widget.add_query_param(key, value)
|
||||
|
Reference in New Issue
Block a user