netbox-community / netbox-bgp

NetBox plugin for BGP related objects documentation
Apache License 2.0
251 stars 52 forks source link

Add key to ChoiceSets to allow user override of choices #189

Closed cruse1977 closed 6 months ago

cruse1977 commented 6 months ago

Is your feature request related to a problem? Please describe. In certain plugins and certain netbox choicesets themselves, users are able to override the choiceset via the FIELD_CHOICES variable in configuration.py. This is achieved by adding a 'key' attribute under the choiceset itself.

eg (from netbox-inventory):

class AssetStatusChoices(ChoiceSet):
    key = 'Asset.status'

meaning its then possible to reference (as per the example above) nb_inventory.Asset.status to override or add to the pre-configured choices.

Describe the solution you'd like As above a key on BGPSessionStatus to allow configuration.py overrides and additional choices. Note this should only apply where choices are descriptive

Describe alternatives you've considered n/a

Additional context

natm commented 6 months ago

https://linear.app/netboxlabs/issue/BIZ-3/

cruse1977 commented 6 months ago

Completed in PR