Re: [Django] #19671: Model field option "validators" not working with ManyToManyField

2014-07-09 Thread Django
#19671: Model field option "validators" not working with ManyToManyField
-+-
 Reporter:  fabio@…  |Owner:
 Type:  Bug  |  anubhav9042
Component:  Forms|   Status:  closed
 Severity:  Normal   |  Version:  master
 Keywords:  validators   |   Resolution:  fixed
  ManyToManyField| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"011abb7d96c75f6154c15a8a0f997d8c27698679"]:
 {{{
 #!CommitTicketReference repository=""
 revision="011abb7d96c75f6154c15a8a0f997d8c27698679"
 Fixed #19671 -- Added warnings that null and validators are ignored for
 ManyToManyField.

 Thanks Loic Bistuer and Tim Graham for help and review.
 }}}

-- 
Ticket URL: 
Django 
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/075.6a1e4c975ef61a96f414603b26370140%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #19671: Model field option "validators" not working with ManyToManyField

2014-07-09 Thread Django
#19671: Model field option "validators" not working with ManyToManyField
-+-
 Reporter:  fabio@…  |Owner:
 Type:  Bug  |  anubhav9042
Component:  Forms|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:  validators   |   Resolution:
  ManyToManyField| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by anubhav9042):

 https://github.com/django/django/pull/2898

-- 
Ticket URL: 
Django 
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/075.088c33bdd5d13ba4acb6b926c689ca71%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #19671: Model field option "validators" not working with ManyToManyField

2014-07-09 Thread Django
#19671: Model field option "validators" not working with ManyToManyField
-+-
 Reporter:  fabio@…  |Owner:
 Type:  Bug  |  anubhav9042
Component:  Forms|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:  validators   |   Resolution:
  ManyToManyField| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by loic84):

 * cc: loic84 (added)


-- 
Ticket URL: 
Django 
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/075.437f12509cfaaefb7db2b6450d573f0a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #19671: Model field option "validators" not working with ManyToManyField

2014-07-09 Thread Django
#19671: Model field option "validators" not working with ManyToManyField
-+-
 Reporter:  fabio@…  |Owner:
 Type:  Bug  |  anubhav9042
Component:  Forms|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:  validators   |   Resolution:
  ManyToManyField| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by loic84):

 Proposed patch from Anubhav tries to reuse `ManyToManyField.validators` at
 the form level and I don't think we should do that: model field validators
 are for model validation only.

 It was proposed on IRC to make `obj.m2m.add()` use the validators, but
 that's conflicting with the design decision that model validation should
 be completely optional.

 Regarding `null` it obviously has no meaning on a M2M since there is no
 corresponding field on the model. For `blank` I'm pretty sure that model
 validation would completely ignore it as checking it would require an
 additional query; however, model forms and admin might, so it's worth
 double checking.

 I'm leaning towards a docs patch, and possibly system checks.

-- 
Ticket URL: 
Django 
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/075.d29c5129402180813900c65adda2ba72%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #19671: Model field option "validators" not working with ManyToManyField

2014-07-09 Thread Django
#19671: Model field option "validators" not working with ManyToManyField
-+-
 Reporter:  fabio@…  |Owner:
 Type:  Bug  |  anubhav9042
Component:  Forms|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:  validators   |   Resolution:
  ManyToManyField| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by anubhav9042):

 Regarding the kwargs `null` and `blank`. They do not seem to be meaningful
 in case of M2M as if either is null then there is actually no relation, so
 it should be mentioned in the docs.

-- 
Ticket URL: 
Django 
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/075.e4cf6eca2d5b2e6ff79faac279a4c6cb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #19671: Model field option "validators" not working with ManyToManyField

2014-07-08 Thread Django
#19671: Model field option "validators" not working with ManyToManyField
-+-
 Reporter:  fabio@…  |Owner:
 Type:  Bug  |  anubhav9042
Component:  Forms|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:  validators   |   Resolution:
  ManyToManyField| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by anubhav9042):

 In case of `Models`, we make objects like:

 {{{
 obj = Model1(name="myname")
 obj.full_clean()
 obj.save()
 obj.m2m_field.add(objs)
 }}}
 So in case of `Models`, calling full_clean() will definitely not run
 validators for M2M.
 So for the case of `Models`, we should update the docs that validators for
 M2M do not work, but as Florian(fhahn) says that validators could be used
 in case of forms, I too am of the same opinion because in case of forms,
 when we provide the entire data all at once, we can surely run the
 validators on it when `full_clean()` on `ModelForm` is called, for which I
 have attached a patch.

-- 
Ticket URL: 
Django 
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/075.6c6e329261f615bd8481ac2d48c0fce4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #19671: Model field option "validators" not working with ManyToManyField

2014-07-08 Thread Django
#19671: Model field option "validators" not working with ManyToManyField
-+-
 Reporter:  fabio@…  |Owner:
 Type:  Bug  |  anubhav9042
Component:  Forms|   Status:  assigned
 Severity:  Normal   |  Version:  master
 Keywords:  validators   |   Resolution:
  ManyToManyField| Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by anubhav9042):

 * owner:  fhahn => anubhav9042
 * has_patch:  0 => 1


-- 
Ticket URL: 
Django 
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/075.97e8da716696208dc5e3a7c5501960ae%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #19671: Model field option "validators" not working with ManyToManyField

2013-02-22 Thread Django
#19671: Model field option "validators" not working with ManyToManyField
-+-
 Reporter:  fabio@…  |Owner:  fhahn
 Type:  Bug  |   Status:  assigned
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  validators   | Triage Stage:  Accepted
  ManyToManyField|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by carljm):

 * stage:  Unreviewed => Accepted


Comment:

 Not immediately obvious to me whether this will be reasonably fixable or
 not, but if not then a documentation fix is still clearly required.

-- 
Ticket URL: 
Django 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19671: Model field option "validators" not working with ManyToManyField

2013-02-09 Thread Django
#19671: Model field option "validators" not working with ManyToManyField
-+-
 Reporter:  fabio@…  |Owner:  fhahn
 Type:  Bug  |   Status:  assigned
Component:  Forms|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:  validators   | Triage Stage:
  ManyToManyField|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by fhahn):

 * status:  new => assigned
 * cc: flo@… (added)
 * needs_better_patch:   => 0
 * component:  Uncategorized => Forms
 * needs_tests:   => 0
 * version:  1.4 => master
 * owner:  nobody => fhahn
 * needs_docs:   => 0


Comment:

 I've added a test that checks the behavior described by the author of the
 ticket.

 I think part of the problem is, that m2m validation cannot be done before
 saving the object, because the object needs a pk before a m2m related
 object can be added (using .add()). But the validator could be used during
 form validation. If not, we should at least document that the validators
 kwarg does not work for ManyToManyField (the null and blank kwarg are
 ignored too).

-- 
Ticket URL: 
Django 
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.
For more options, visit https://groups.google.com/groups/opt_out.




[Django] #19671: Model field option "validators" not working with ManyToManyField

2013-01-25 Thread Django
#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: 
Django 
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.