Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#1068 closed defect (invalid)

Silly bug in ForiegnKey

Reported by: Eric Moritz Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: minor Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


This works when it probably shouldn't

from django.models import places
class MyModel(meta.Model):
  place = meta.ForeignKey(places.Place)

If someone accidentally uses the app module's Place class in a foreign key, everything seems to work except the place object will not get the get_mymodel_... methods. It should throw an error if that occurs otherwise it's not obvious that something is wrong.

Change History (2)

comment:1 Changed 11 years ago by Adrian Holovaty

What you described is the standard way of designating ForeignKeys, so I'm not sure what the problem is...Could you explain things more in depth?

I suspect you're not getting the "get_mymodel" methods, because the places app isn't in your INSTALLED_APPS.

comment:2 Changed 11 years ago by mir@…

Resolution: invalid
Status: newclosed

This is obviously invalid and looks stone dead.

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