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

Closes #1110: Expand bulk edit forms to include boolean fields (e.g. toggle is_pool for prefixes)

This commit is contained in:
Jeremy Stretch
2017-04-28 12:32:27 -04:00
parent e7a6d1f532
commit aea5612c39
4 changed files with 33 additions and 7 deletions

View File

@@ -138,6 +138,19 @@ class ColorSelect(forms.Select):
option_value, selected_html, option_value, force_text(option_label))
class BulkEditNullBooleanSelect(forms.NullBooleanSelect):
def __init__(self, *args, **kwargs):
super(BulkEditNullBooleanSelect, self).__init__(*args, **kwargs)
# Override the built-in choice labels
self.choices = (
('1', '---------'),
('2', 'Yes'),
('3', 'No'),
)
class SelectWithDisabled(forms.Select):
"""
Modified the stock Select widget to accept choices using a dict() for a label. The dict for each option must include