#28110: Model inheritance field name collision check error refers to related
accessors as fields
--------------------------------------+------------------------------------
     Reporter:  Matthew Schinckel     |                    Owner:  nobody
         Type:  Bug                   |                   Status:  new
    Component:  Core (System checks)  |                  Version:  1.11
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

 * stage:  Unreviewed => Accepted
 * component:  Database layer (models, ORM) => Core (System checks)


Comment:

 Bisected to 4bc00defd0cf4de3baf90cad43da62e531987459. I think the warning
 is correct as there is a `Region.organisation` accessor that your foreign
 key is overriding. Using the models you provided but without with foreign
 keys:
 {{{
 u = OrgUnit.objects.create()
 o = Organisation.objects.create(orgunit_ptr=u)
 r = Region.objects.create(orgunit_ptr=u)
 r.organisation == o
 }}}
 I think the warning's wording must be corrected to something like "The
 field 'organisation' clashes with the related accessor 'organisation' from
 model 'org.orgunit'." but I'm not certain about this analysis. It might be
 possible to continue to allow the overriding you've been doing -- I'm not
 sure if a patch is feasible.

--
Ticket URL: <https://code.djangoproject.com/ticket/28110#comment:1>
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/067.e369cd2699fb6b744b0ca3e897afa58a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to