Code

Opened 9 years ago

Closed 9 years ago

#217 closed defect (invalid)

Multiple foreign keys to one table

Reported by: mordaha@… Owned by: adrian
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: UI/UX:

Description

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')

Attachments (0)

Change History (2)

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

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

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.