[SQLObject] Inheritance and MultipleJoin
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Luis J. P. <jav...@gm...> - 2008-08-12 16:18:44
|
I'd like to know if there is a restriction using inheritance about multiplejoin function because I'm getting an error and I don't know why. I've the following code: class Question(InheritableSQLObject): filename = StringCol(default=None, length=255, unique=True) title = StringCol(default=None) default_mark = FloatCol(default=0.0) wording = RelatedJoin('Content') term_questions = RelatedJoin('Term', joinColumn='term', otherColumn='question', intermediateTable='Term_questions') answers = MultipleJoin('Answer') questionref = MultipleJoin('QuestionRef') class Answer(SQLObject): value = StringCol(default=None) calification = FloatCol(default=None) ide = StringCol(default=None) question = ForeignKey('Question') class Ord(Question): _inheritable = False shuffle = BoolCol() orderanswers = MultipleJoin('OrderChoice') class OrderChoice(SQLObject): value = StringCol(default=None) ord = IntCol(default=None) ide = StringCol(default=None) question = ForeignKey('Ord') and when I've a Ord instance (called 'q') and I do 'q.orderanswers' I get the following error: sqlobject.dberrors.OperationalError: Unknown column 'ord_id' in 'where clause' Any idea? Thanks!! |