Re: raise error for form attribute

2017-05-11 Thread Naveen Yadav


On Wednesday, 10 May 2017 16:48:00 UTC+5:30, Naveen Yadav wrote:
>
> 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.
>
>

-- 
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+unsubscr...@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/5516d7d4-079a-4253-8477-9220516ea877%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: raise error for form attribute

2017-05-10 Thread Adam Johnson
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?

On 10 May 2017 at 10:19, Naveen Yadav  wrote:

> 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.
>
> --
> 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+unsubscr...@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

-- 
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+unsubscr...@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/CAMyDDM3n3160k_8hthMVWUtPku%3DqmbBQ6jaagfo4sA45EFzaRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


raise error for form attribute

2017-05-10 Thread Naveen Yadav
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.

-- 
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+unsubscr...@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.