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
To create a setting with a custom checker is rather painful process. There are options, but for example to create a setting which allows both - string and list of strings - is not very easy. I can't reuse neither StringSetting, not IterableSetting as I can't change the checker in either of those.
I suggest to use similar approach as is used in Django in form fields' and models fields' validators. Each Setting would have default validators, an option to pass additional validators and possibly other arguments which would be transform into validators.
Also I suggest to reuse Django validators instead of checkers, where possible as it would decrease code duplication.
The text was updated successfully, but these errors were encountered:
Yes this is exactly what I wanted to do. I don't like the current system of "checkers" (not even the name). Django validators is the way to go (less friction for new users and already battle-tested). I had looked at it before and they seemed a bit overpowered (with a lot of class inheritance) but I'm sure we can find a way to use them.
To create a setting with a custom checker is rather painful process. There are options, but for example to create a setting which allows both - string and list of strings - is not very easy. I can't reuse neither
StringSetting
, notIterableSetting
as I can't change thechecker
in either of those.I suggest to use similar approach as is used in Django in form fields' and models fields' validators. Each
Setting
would have default validators, an option to pass additional validators and possibly other arguments which would be transform into validators.Also I suggest to reuse Django validators instead of checkers, where possible as it would decrease code duplication.
The text was updated successfully, but these errors were encountered: