Re: [Django] #26200: Integrity constraint violations when ForeignKey field is not included on the ModelForm

2016-02-11 Thread Django
#26200: Integrity constraint violations when ForeignKey field is not included on
the ModelForm
--+--
 Reporter:  goodtune  |Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  Forms |  Version:  1.8
 Severity:  Normal|   Resolution:  duplicate
 Keywords:| Triage Stage:  Unreviewed
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by goodtune):

 * status:  new => closed
 * resolution:   => duplicate


--
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/066.37865599cc21d52158e56e8dc38c9aa2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26200: Integrity constraint violations when ForeignKey field is not included on the ModelForm

2016-02-10 Thread Django
#26200: Integrity constraint violations when ForeignKey field is not included on
the ModelForm
--+--
 Reporter:  goodtune  |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  Forms |  Version:  1.8
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Unreviewed
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--

Comment (by timgraham):

 Yes, I think we need some solution as described in #13091. I believe your
 [https://github.com/django/django/pull/6112 proposed patch] breaks the
 case where a developer adds a value for a field in the `unique_together`
 to the model after form validation. In that case we'll now get a
 validation error with no chance to correct it.

 I think we can mark this ticket as a duplicate of that one, but let me
 know if you feel otherwise.

--
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/066.3f5d66c9b2d8a524a3e1a12ee90650e0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26200: Integrity constraint violations when ForeignKey field is not included on the ModelForm

2016-02-10 Thread Django
#26200: Integrity constraint violations when ForeignKey field is not included on
the ModelForm
--+--
 Reporter:  goodtune  |Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  Forms |  Version:  1.8
 Severity:  Normal|   Resolution:
 Keywords:| Triage Stage:  Unreviewed
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+--
Changes (by goodtune):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 On further searching of the developers mailing list, this might be a
 partial of #13091?

 I hadn't experienced the behaviour on non-FK fields, but it would not be
 too difficult remove the `if
 isinstance(self.instance._meta.get_field(field_name), models.ForeignKey)`
 check.

 Unfortunately makes
 `model_forms.tests.ModelFormBaseTest.test_exclude_and_validation` fail,
 and the comment in that test notes ''"This is for backwards
 compatibility."'' which is worrying since #13091 is 6 years old!

--
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/066.7bce031ad2b889276e12ba1dcc6ad592%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #26200: Integrity constraint violations when ForeignKey field is not included on the ModelForm

2016-02-09 Thread Django
#26200: Integrity constraint violations when ForeignKey field is not included on
the ModelForm
+
 Reporter:  goodtune|  Owner:  nobody
 Type:  Bug | Status:  new
Component:  Forms   |Version:  1.8
 Severity:  Normal  |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  1
Easy pickings:  0   |  UI/UX:  0
+
 Using the `Author` and `Book` example from the `model_forms` tests, `Book`
 has a `unique_together` constraint on `('title', 'author')`.

 If we have a `ModelForm` which only includes the `'title'` field, and use
 that to update an instance in such a way that it would cause a violation
 of this constraint, the existing behaviour is to validate the form and
 allow an update.

 Unfortunately this results in an `IntegrityError`.

 There is a work around - it's possible to manually catch this in your own
 clean methods on the model or form.

--
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/051.e0855268e7cba96fc01a419bfdb62a65%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.