You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Custom script where a user can select from a dropdown, and based on that dropdown, prefixes are selected in an ObjectVar.
The query_params takes the ChoiceVar with a $ in front, but I can't seem to find a way to use that in the 'default'
CONTAINERS = (
('prefixtagSite1', 'Site1),
('prefixtagSite2', 'Site2),
)
env_container = ChoiceVar(
description="Location to select the Prefix",
label='Location',
choices = CONTAINERS,
default = 'prefixtagSite1'
)
env_prefix = ObjectVar(
description="Prefix to carve subnet out",
label='Prefix',
model=Prefix,
query_params={ 'tag' : '$env_container' },
default=Prefix.objects.filter(tags__slug='$env_container',custom_field_data__Utilization__lt=100)[:1]
# the default is not taking the $env_container value...
)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I have a Custom script where a user can select from a dropdown, and based on that dropdown, prefixes are selected in an ObjectVar.
The query_params takes the ChoiceVar with a $ in front, but I can't seem to find a way to use that in the 'default'
Is this possible ?
Pieter
Beta Was this translation helpful? Give feedback.
All reactions