Opened 18 years ago
Closed 18 years ago
#5642 closed (duplicate)
[patch] models.ForeignKey('unloaded class') raises AttributeError
| Reported by: | Gregor_Kopka | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (Other) | Version: | dev |
| Severity: | Keywords: | ForeignKey AttributeError db/models/options.py | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
using
models.ForeignKey('undefined class')
in model definition raises an Attribute error:
File "/usr/lib/python2.4/site-packages/django/db/models/options.py", line 156, in get_all_related_objects
if f.rel and self == f.rel.to._meta:
Using the attached patch the output will be:
Error: One or more models did not validate:
<reasonable error message>
Attachments (1)
Change History (4)
comment:1 by , 18 years ago
| Summary: | models.ForeignKey('unloaded class') raises AttributeError → [patch] models.ForeignKey('unloaded class') raises AttributeError |
|---|
comment:2 by , 18 years ago
comment:3 by , 18 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
Added the patch to #3323.
Closing this one.
by , 18 years ago
| Attachment: | patch-foreignkey-attributeerror.diff added |
|---|
Note:
See TracTickets
for help on using tickets.
Seems like i missed #3323 when searching for existance of the bug.
Updated the patch to get the many-to-many relation error described there too.