raise error for form attribute

70 views
Skip to first unread message

Naveen Yadav

unread,
May 10, 2017, 7:18:00 AM5/10/17
to Django developers (Contributions to Django itself)
Hi,

I am working on my first issue. Part of solution seems like
1. checking the concerned fields
2. raising the error if required


After going through the source code, I realized there two ways to resolve the issue, first one seems raise error at appropriate place although a few doubts about this

raise error:

  1. appropriate place to raise error clean() of form class, Will it be fine if i raise error here ?
non_field_error

second solution would be add non_field_error for the form.

Any feedback would be helpful

Thanks.

Adam Johnson

unread,
May 10, 2017, 12:04:53 PM5/10/17
to django-d...@googlegroups.com
clean() and non_field_error both seem like the wrong place since they happen after the first rendering of the form. You should be able to raise it on initialization, no?

--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscribe@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/74b94cdc-987d-40bf-a956-7a5a97fe7cc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Adam

Naveen Yadav

unread,
May 11, 2017, 5:45:53 AM5/11/17
to Django developers (Contributions to Django itself)
Reply all
Reply to author
Forward
0 new messages