mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
* Initial work on #13283 * Enable passing TomSelect HTML template attibutes on DynamicModelChoiceField * Merge disabled_indicator into option_attrs * Add support for annotating a numeric count on dropdown options * Annotate parent object on relevant fields * Improve rendering of color options * Improve rendering of color options * Rename option_attrs to context * Expose option context on ObjectVar for custom scripts * Document dropdown context variables
This commit is contained in:
@@ -30,7 +30,9 @@ def get_cable_form(a_type, b_type):
|
||||
attrs[f'{cable_end}_terminations'] = DynamicModelMultipleChoiceField(
|
||||
queryset=term_cls.objects.all(),
|
||||
label=term_cls._meta.verbose_name.title(),
|
||||
disabled_indicator='_occupied',
|
||||
context={
|
||||
'disabled': '_occupied',
|
||||
},
|
||||
query_params={
|
||||
'device_id': f'$termination_{cable_end}_device',
|
||||
'kind': 'physical', # Exclude virtual interfaces
|
||||
@@ -52,7 +54,9 @@ def get_cable_form(a_type, b_type):
|
||||
attrs[f'{cable_end}_terminations'] = DynamicModelMultipleChoiceField(
|
||||
queryset=term_cls.objects.all(),
|
||||
label=_('Power Feed'),
|
||||
disabled_indicator='_occupied',
|
||||
context={
|
||||
'disabled': '_occupied',
|
||||
},
|
||||
query_params={
|
||||
'power_panel_id': f'$termination_{cable_end}_powerpanel',
|
||||
}
|
||||
@@ -72,7 +76,9 @@ def get_cable_form(a_type, b_type):
|
||||
attrs[f'{cable_end}_terminations'] = DynamicModelMultipleChoiceField(
|
||||
queryset=term_cls.objects.all(),
|
||||
label=_('Side'),
|
||||
disabled_indicator='_occupied',
|
||||
context={
|
||||
'disabled': '_occupied',
|
||||
},
|
||||
query_params={
|
||||
'circuit_id': f'$termination_{cable_end}_circuit',
|
||||
}
|
||||
|
Reference in New Issue
Block a user