Make CircuitPriorityChoices extensible

This commit is contained in:
Jeremy Stretch 2024-07-24 09:13:33 -04:00
parent 41aafa762b
commit 16e32c87f6
2 changed files with 16 additions and 8 deletions

View File

@ -1,19 +1,25 @@
# Circuit Group Assignments
Circuits can be assigned to [Circuit groups](./circuitgroup.md) to indicate Fallback Circuits. For instance, three circuits, each belonging to a different provider, may each be assigned to the same Circuit group. Each of these assignments would typically receive a different priority.
Circuits are assigned to Circuit groups under the Circuit Group detail view.
Circuits can be assigned to [circuit groups](./circuitgroup.md) for correlation purposes. For instance, three circuits, each belonging to a different provider, may each be assigned to the same circuit group. Each assignment may optionally include a priority designation.
## Fields
### Group
The [Circuit group](./circuitgroup.md) being assigned.
The [circuit group](./circuitgroup.md) being assigned.
### Circuit
The [Circuit](./circuit.md) that is being assigned to the group.
The [circuit](./circuit.md) that is being assigned to the group.
### Priority
A selection (Primary, Secondary, Tertiary) indicating the circuit's priority for being elected as the master/primary node in the group.
The circuit's operation priority relative to its peers within the group. The assignment of a priority is optional. Choices include:
* Primary
* Secondary
* Tertiary
* Inactive
!!! tip
Additional priority choices may be defined by setting `CircuitGroupAssignment.priority` under the [`FIELD_CHOICES`](../../configuration/data-validation.md#field_choices) configuration parameter.

View File

@ -79,14 +79,16 @@ class CircuitTerminationPortSpeedChoices(ChoiceSet):
class CircuitPriorityChoices(ChoiceSet):
key = 'CircuitGroupAssignment.priority'
PRIORITY_PRIMARY = 'primary'
PRIORITY_SECONDARY = 'secondary'
PRIORITY_TERTIARY = 'tertiary'
PRIORITY_INACTIVE = 'inactive'
CHOICES = (
CHOICES = [
(PRIORITY_PRIMARY, _('Primary')),
(PRIORITY_SECONDARY, _('Secondary')),
(PRIORITY_TERTIARY, _('Tertiary')),
(PRIORITY_INACTIVE, _('Inactive')),
)
]