Re: [Sqlalchemy-tickets] [sqlalchemy] #2725: The sense foreign_keys parameter to orm.relationship i
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-05-09 19:30:10
|
#2725: The sense foreign_keys parameter to orm.relationship is unclear
-------------------------------------------+-------------------------------
Reporter: amluto | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.8.xx
Component: documentation | Severity: no triage
Resolution: | selected yet
Progress State: needs questions answered | Keywords:
-------------------------------------------+-------------------------------
Comment (by amluto):
Hmm. That particular example is actually not bad, although I got thrown
off a bit since I don't use Declarative. (My project predates
declarative.)
The actual situation I have is that there are three tables, A, B, and C.
B is a child of A and C is a child of both A and B.
A has a_id, B has a_id (a foreign key to A) and b_id (its primary key). C
has a_id and b_id. The catch is that, for each row in C, we require that
a_id match both a row in A and the a_id from the corresponding row in B.
So the ForeignKey to A in the schema is unnecessary, but I still want to
map it.
I still think that making the documentation for the foreign_key parameter
(as opposed to just an example) unambiguous would improve the situation.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2725#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|