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

WIP: Initial work on the cable connection form

This commit is contained in:
Jeremy Stretch
2018-10-22 16:58:24 -04:00
parent a36b120c8b
commit 471bddea09
13 changed files with 275 additions and 20 deletions

View File

@@ -207,6 +207,15 @@ class SelectWithPK(forms.Select):
option_template_name = 'widgets/select_option_with_pk.html'
class ContentTypeSelect(forms.Select):
"""
Appends an `api-value` attribute equal to the slugified model name for each ContentType. For example:
<option value="37" api-value="console-server-port">console server port</option>
This attribute can be used to reference the relevant API endpoint for a particular ContentType.
"""
option_template_name = 'widgets/select_contenttype.html'
class ArrayFieldSelectMultiple(SelectWithDisabled, forms.SelectMultiple):
"""
MultiSelect widget for a SimpleArrayField. Choices must be populated on the widget.