#22374: Suggest to validate unique before running clean in models full_clean 
etc..
-------------------------------------+-------------------------------------
     Reporter:  dspjmt@…             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  1.6
  (models, ORM)                      |               Resolution:  needsinfo
     Severity:  Normal               |             Triage Stage:
     Keywords:                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Jimmy):

 Replying to [comment:3 Jimmy]:
 > Let's say, I have a module like:
 >
 > class A(Model):
 >     b = IntegerField(max_length=3)

 Sorry, b = IntegerField()

 >
 >     clean(self):
 >         if b < 3:
 >             raise ValidationError('Too large')
 >
 > When we use a form, if b is not filled, error will happen because b
 don't have a value. So we have to check if b has value, which was done in
 validate_unique(). So why not validate_unique first and then call clean?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22374#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/074.1c3cbb0cbe1a7370998b9940169a1532%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to