Opened 18 years ago

Last modified 18 years ago

#805 closed defect

OneToOneField conflicts with ForeignKey — at Version 1

Reported by: kevinastone@… Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: normal 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 (last modified by Adrian Holovaty)

I have a model class that has both a OneToOneField and a ForeignKey to the same other class. Eg.

class Base(meta.Model):
    name = CharField()

class Extension(meta.Model):
    base = meta.OneToOneField(Base)
    parent = meta.ForeignKey(Base)

When using Base instance, when I try to call Base.get_extension() it uses the parent foreign key reference instead of the base OneToOne reference.

Change History (1)

comment:1 by Adrian Holovaty, 18 years ago

Description: modified (diff)

(Fixed formatting in description.)

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