#24867: admin.E202 seems to include superclass references?
---------------------------------+------------------------
Reporter: TorstenRottmann | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.7
Severity: Normal | Keywords: admin.E202
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------
I have this three models defined:
{{{
class Act(models.Model):
....
class Form(Act):
...
class Diagnosis(Act):
form = models.ForeignKey(Form)
}}}
...and this admin.py:
{{{
class DiagnosisInline(admin.TabularInline):
model = Diagnosis
...
class FormAdmin(admin.ModelAdmin):
....
inlines = [DiagnosisInline]
admin.site.register(Form, FormAdmin)
}}}
This triggers 'admin.E202':
{{{
<class 'nm.admin.DiagnosisInline'>: (admin.E202) 'nm.Diagnosis' has more
than one ForeignKey to 'nm.Form'
}}}
Without looking into the source for this system check, I guess, that it
counts all possible references, that lead to the admin class, the inline
is included in.
And it counts two, from which one is right (Form) and one is wrong (Act),
because it's already it's own superclass reference.
Am I right?
--
Ticket URL: <https://code.djangoproject.com/ticket/24867>
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/058.0bdf955f9b70b539048402e178215ae4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.