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
If the value of this key is missing or “” in the configuration file, then an error is raised.
Only if the key is missing, then it is set to the default, here key = [ “john” ]
I would like to return in my validation function the default if value is empty, e.g.
def is_mytype(value,*options):
if not value:
return default
...
How could I do that ?
Or is it possible that the default be returned if the value is missing in the configuration file or "" ?
Thanks for the help!
The text was updated successfully, but these errors were encountered:
Hi,
I defined my own validation function:
and so
val = Validator({'mytype': is_mytype })
In the spec file I have
key = mytype(“john”,”jack”,”patrick”,default=list(“john”))
If the value of this key is missing or “” in the configuration file, then an error is raised.
Only if the key is missing, then it is set to the default, here
key = [ “john” ]
I would like to return in my validation function the default if
value
is empty, e.g.How could I do that ?
Or is it possible that the default be returned if the value is missing in the configuration file or "" ?
Thanks for the help!
The text was updated successfully, but these errors were encountered: