Opened 11 years ago

Closed 11 years ago

#5642 closed (duplicate)

[patch] models.ForeignKey('unloaded class') raises AttributeError

Reported by: Gregor_Kopka Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: ForeignKey AttributeError db/models/
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no



models.ForeignKey('undefined class')

in model definition raises an Attribute error:

File "/usr/lib/python2.4/site-packages/django/db/models/", line 156, in get_all_related_objects

if f.rel and self ==

Using the attached patch the output will be:

Error: One or more models did not validate:
<reasonable error message>

Attachments (1)

patch-foreignkey-attributeerror.diff (6.9 KB) - added by Gregor_Kopka 11 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 11 years ago by Gregor_Kopka

Summary: models.ForeignKey('unloaded class') raises AttributeError[patch] models.ForeignKey('unloaded class') raises AttributeError

comment:2 Changed 11 years ago by Gregor_Kopka

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.

comment:3 Changed 11 years ago by Gregor_Kopka

Resolution: duplicate
Status: newclosed

Added the patch to #3323.
Closing this one.

Changed 11 years ago by Gregor_Kopka

Note: See TracTickets for help on using tickets.
Back to Top