Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#1068 closed defect (invalid)

Silly bug in ForiegnKey

Reported by: Eric Moritz Owned by: adrian
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:

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 Changed 9 years ago by adrian

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

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

This is obviously invalid and looks stone dead.

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