On 11.12.2008 11:10 Uhr, [EMAIL PROTECTED] wrote:
> afaik, u can supply strings instead of real things everywhere in those
> arguments.. they are eval()ed against some context at later time.
>
This works to some degree:
class Hierarchies(Base):
__tablename__ = 'hierarchies'
__table_args__ = (
{ 'autoload' : True, })
parent_id = Column('parent_id', Integer, ForeignKey('hierarchies.id'))
_children = relation('Hierarchies',
primaryjoin='Hierarchies.parent_id==Hierarchies.id',
order_by=['Hierarchies.pos'],
cascade="all",
backref=backref("parent",
remote_side=['Hierarchies.id'])
hso = session.query(Hierarchies).filter_by(id=1641).one()
print hso._children
for c in hso._children:
print c
hso._children is a PropertyLoader instance in this case that can not be used
for iteration.
The "same" code implemented as standard mapper using SA 0.3 behaves as
it should.
I can not see the difference how to make it work with SA 0.5.
Andreas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[EMAIL PROTECTED]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard