#1826 closed defect (duplicate)
Model crashes with ForeignKey('self') and a field with the same name
| Reported by: | Owned by: | Adrian Holovaty | |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The following model will fail on install:
class Test(models.Model): this = models.ForeignKey("self") test = models.TextField() class Admin: pass
with this message:
At least one field in Test should have core=True, because it's being edited inline by test.Test.
If you add core=True as the message suggests:
class Test(models.Model): this = models.ForeignKey("self") test = models.TextField(core=True) class Admin: pass
then the admin crashes on the add page with the following error:
Exception Type: AttributeError Exception Value: 'bool' object has no attribute 'get' Exception Location: django\db\models\related.py in get_manipulator_fields, line 112
Note:
See TracTickets
for help on using tickets.
See #1839.