[SQLObject] InheritableSQLObject and MultipleJoins
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Jonathan W. <jwi...@to...> - 2006-12-04 00:21:11
|
I've got a three level inheritance model that looks a little like this: class Node(InheritableSQLObject): parent = ForeignKey('Node', default = None) children = MultipleJoin('Node', joinColumn = 'parent_id') class ContentNode(Node): content = StringCol(default = None) class Page(ContentNode): comments = MultipleJoin('Comment', joinColumn = 'parent_id') class Comment(ContentNode): pass And create some test data like so: thePage = Page(content = 'Page 1') theComment = Comment(content = 'Comment 1') theComment.parent = thePage When I print the children of the page, everything is correct (i.e. the one comment is listed) print thePage.children When I try to print the comments of the page, I get an error: print thePage.comments Is MultipleJoin not smart enough to understand instances of InheritableSQLObject? And if not is this behavior a bug that will be fixed in the future? Jon. |