Opened 8 years ago

Closed 8 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: UI/UX:



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 8 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 8 years ago by Gregor_Kopka

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from models.ForeignKey('unloaded class') raises AttributeError to [patch] models.ForeignKey('unloaded class') raises AttributeError

comment:2 Changed 8 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 8 years ago by Gregor_Kopka

  • Resolution set to duplicate
  • Status changed from new to closed

Added the patch to #3323.
Closing this one.

Changed 8 years ago by Gregor_Kopka

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