Re: [Sqlalchemy-tickets] [sqlalchemy] #2900: relationship aliased on subclass causes infinite recur
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2014-01-01 18:17:01
|
#2900: relationship aliased on subclass causes infinite recursion
---------------------------+-------------------------------
Reporter: scraper | Owner: zzzeek
Type: defect | Status: new
Priority: highest | Milestone: 0.9.xx
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in queue |
---------------------------+-------------------------------
Comment (by zzzeek):
OK figuring out what's happening here, and also considering what exactly
is `synonym()` for really, if we can just do this? What is basically the
pattern here is that the `InstrumentedAttribute` is just assigned a second
time somewhere else. declarative isn't really getting involved here other
than just setting the attribute. same pattern in classical:
{{{
#!python
from sqlalchemy import Column, Integer, ForeignKey, Table, MetaData
from sqlalchemy.orm import relationship, backref, mapper
m = MetaData()
child = Table('child', m,
Column('id', Integer, primary_key=True),
Column('foo_id', ForeignKey('foo.id'))
)
foo = Table('foo', m,
Column('id', Integer, primary_key=True)
)
class Child(object):
pass
class Foo(object):
pass
class FooChild(Child):
pass
mapper(Child, child, properties={
'foo': relationship(Foo, backref=backref('children'))
})
mapper(Foo, foo)
mapper(FooChild, None, inherits=Child)
Child.parent = Child.foo
Child.brap = Child.foo_id
fc = FooChild()
fc.parent = Foo()
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2900#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|