forms - switch off the validation

12 views
Skip to first unread message

Kai Kobschätzki

unread,
Jul 30, 2019, 12:42:18 AM7/30/19
to django...@googlegroups.com
Heiho,

I wrote a form in forms.py with some validation stuff, especially with
def clean_field(). All fine. But in some usecases I would prefare to
switch off at least some of the validation. For example it make no sense
to check for a double id when I want to delete a reccord. Is it possible
to swith them off with reuse the form and not with write nearly the same
form (don't repeat yourself..).

Thanks and Greetings,

bengoshi



Aldian Fazrihady

unread,
Jul 30, 2019, 12:50:06 AM7/30/19
to django...@googlegroups.com
You probably can extend the form class and override the is_valid method. Make the new is_valid to always return True.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/41b2edc1-307a-a0e6-d389-a0051d38c787%40gmail.com.


--
Regards,

Reply all
Reply to author
Forward
0 new messages