Ticket #26 (accepted enhancement)

Opened 5 years ago

Last modified 4 years ago

establish onetomany on unique, non primarykey, index

Reported by: guest Owned by: ged
Priority: minor Milestone: 0.8
Component: core Version:
Keywords: Cc:

Description

i would like to establish the one side of an onetomany relationship on a regular unique index (but not a primarykey).

in his answer to my post, gaetan wrote: I should make it possible as SQLAlchemy allows this.

I see two (complementary) options to do that: * provide a "target_columns" arguments, which would list the name of the column(s) you want to target. That would probably be enough for you. * detect that a join argument (primary_join and possibily secondary_join) is present and don't create any column in that case.

i'd really prefer the explicit (first) version.

Change History

Changed 5 years ago by ged

  • owner set to ged
  • status changed from new to accepted

Changed 5 years ago by ged

  • priority changed from major to minor

Changed 5 years ago by ged

  • milestone set to 0.7

In other words, allow for a OneToMany without ManyToOne counterpart, but without the relationship being viewonly.

Changed 5 years ago by ged

Partially done in r405. Btw: the OneToMany without ManyToOne is a distinct feature (which is desirable too) -> moved to ticket #74.

Changed 4 years ago by ged

  • milestone changed from 0.7 to 0.8

Changed 4 years ago by ged

From the commit message: "This is harder than I initially thought: it breaks if the target is declared after the class holding the ManyToOne."

See http://elixir.ematia.de/trac/browser/elixir/trunk/tests/test_m2o.py#L203

Note: See TracTickets for help on using tickets.