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

Closes #3594: Add ChoiceVar for custom scripts

This commit is contained in:
Jeremy Stretch
2019-10-23 15:59:27 -04:00
parent 95fec1a87c
commit c7d8083ac6
4 changed files with 65 additions and 0 deletions

View File

@@ -119,6 +119,23 @@ Stored a numeric integer. Options include:
A true/false flag. This field has no options beyond the defaults.
### ChoiceVar
A set of choices from which the user can select one.
* `choices` - A list of `(value, label)` tuples representing the available choices. For example:
```python
CHOICES = (
('n', 'North'),
('s', 'South'),
('e', 'East'),
('w', 'West')
)
direction = ChoiceVar(choices=CHOICES)
```
### ObjectVar
A NetBox object. The list of available objects is defined by the queryset parameter. Each instance of this variable is limited to a single object type.