#25535: ForeignObject checks are too strict
-------------------------------------+-------------------------------------
     Reporter:  acatton              |      Owner:  nobody
         Type:  New feature          |     Status:  new
    Component:  Core (System         |    Version:  master
  checks)                            |   Keywords:  ForeignObject check
     Severity:  Normal               |  framework
 Triage Stage:  Unreviewed           |  Has patch:  1
Easy pickings:  0                    |      UI/UX:  0
-------------------------------------+-------------------------------------
 Let's consider this test case:

 {{{#!python
 class Parent(models.Model):
   a = models.Field()
   b = models.Field()

   class Meta:
     unique_together = (
       ('a', 'b'),
     )

 class Child(models.Model):
   a = models.Field()
   b = models.Field()
   parent = ForeignObject(Parent, from_fields=('a', 'b'), to_fields=('a',
 'b'))
 }}}

 I get the error: `None of the fields 'a', 'b' on 'Parent' have a
 unique=True constraint.` But a and b are unique together, the
 ForeignObject will be functional.

--
Ticket URL: <https://code.djangoproject.com/ticket/25535>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/050.affeba0c284a228f58d3261c594a6bd4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to