Opened 19 years ago

Closed 19 years ago

Last modified 18 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: no UI/UX: no

Description

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 by Adrian Holovaty, 19 years ago

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 by mir@…, 19 years ago

Resolution: invalid
Status: newclosed

This is obviously invalid and looks stone dead.

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