Opened 14 years ago

Closed 14 years ago

#217 closed defect (invalid)

Multiple foreign keys to one table

Reported by: mordaha@… Owned by: Adrian Holovaty
Component: Metasystem 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


It is not possible to have a model with 2 or more ForeignKeyField to one destination table

For example i need a table LETTER with 2 FK to table RECIPIENTS, one FK is a 'From' field, second FK is 'To' field.

It would be better, if FK fieldnames will be assigned from 'rel_name', not from destination object name, so i could use such syntax:

  ForeignKeyField(Recipients, rel_name='from_ppl')
  ForeignKeyField(Recipients, rel_name='to_ppl')

Change History (2)

comment:1 Changed 14 years ago by Clint Ecker <clintecker@…>

You need to do something like this, I think:

ForeignKeyField(Recipients, name="from_ppl")
ForeignKeyField(Recipients, name="to_ppl")

comment:2 Changed 14 years ago by Adrian Holovaty

Resolution: invalid
Status: newclosed

Yes, just do what Clint said. I'm closing this, because it's not a bug.

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