Trying to translate some "inherited" Turboblog SQLObject code to
SQLAlchemy. The Comment class sets up a parent-child relationship
referencing back into the same table:
class Comment(ActiveMapper):
class mapping:
__table__= "comment"
comment_id = column(Integer, primary_key=True)
...
parent_id = column(Integer, default=-1)
sub_comments = one_to_many("Comment", colname="comment_id",
backref="parent_id")
The sqlalchemy exception is:
ArgumentError: Cant find any foreign key relationships between
'comment' and 'comment'
I can see how that might be the case. Is there a recommended way of
doing this using ActiveMapper or do I need to revert to a Table +
mapper setup as exemplified in the zblog code in the sqlalchemy svn
repos
(http://www.sqlalchemy.org/trac/browser/zblog/trunk/lib/zblog/database)?
Cheers,
Graham
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---