-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom form validation #12
Comments
It's currently not easily possible to add form-level validation. What you could do is add a new field definition to |
Hello matthiask, thanks for the answer. If I understand what you suggest, that would require to create a custom field with the appropriate validation Maybe it could become a setting(s)... |
Hi Luca The first part is correct -- you'd have to write a custom field. Subclassing |
I'm afraid I'm missing something. I'm registering Anyway, It is ignoring my append to |
I'm sorry, that was a dumb comment from my side. Of course modifying A setting for form fields would either force you to repeat all form fields, or not allow to exclude existing fields. Not too nice. Maybe modify the admin form ( |
A setting could be imported and modified, as we actually do for any settings related to Django. Why not? That said, actually it seems really hard to change the definition of FIELD_TYPES outside the form designer app. I've tried the following:
No results. Another possible solution could involve the definition of a list of fields in a method inside |
@lucalenardi FIELD_TYPES was ignored because when model is created his choices was populated. This was fixed in #17 using lazy loading |
Thanks! |
Hi,
what's considered the best way to add custom form validation? It could be useful to add a "honeypot" form of spam detection, but I cannot find a simple (by design) method to do it.
Thanks!
The text was updated successfully, but these errors were encountered: