#19671: Model field option "validators" not working with ManyToManyField
-------------------------------+----------------------------------------
     Reporter:  fabio@…        |      Owner:  nobody
         Type:  Bug            |     Status:  new
    Component:  Uncategorized  |    Version:  1.4
     Severity:  Normal         |   Keywords:  validators ManyToManyField
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+----------------------------------------
 {{{
 # models.py

 def validate_depends_on(value):
     # just raise an error, whatever the value
     raise ValidationError('Error')

 class Package(models.Model):
     # ...
     depends_on = models.ManyToManyField(
         'self',
         symmetrical=False,
         related_name='required_by',
         blank=True,
         null=True,
         validators=[validate_depends_on]
         )
 }}}

 My custom validator is not called when saving a model instance through the
 admin. The same validator perfectly works with other fields. Also,
 removing blank and null options didn't help.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19671>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to