Hello,

What is the correct way to use remote_side & single_parent relation
parameters under Declarative Base?

I'm trying to create an Adjacency List Relationship as suggested in
the docs, but I am not sure how to do this with Declarative Base.

I tried:

children = relation("Node", backref=backref("parent",
remote_side="nodes.id"))

But got:

InvalidRequestError: When compiling mapper Mapper|Node|nodes,
expression 'nodes.id' failed to locate a name ("name 'nodes' is not
defined"). If this is a class name, consider adding this relation() to
the <class 'db.Node'> class after both dependent classes have been
defined.


Thank you,
:)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to