[sqlalchemy] Can't get associated model and can't update it in MapperExtension?

2010-09-05 Thread Freewind
There are two classes: User and Question A user may have many questions, and it also contains a question_count to record the the count of questions belong to him. So, when I add a new question, I want update the question_count of the user. At first, I do as: question = Question(title='aaa',

Re: [sqlalchemy] Can't get associated model and can't update it in MapperExtension?

2010-09-05 Thread Michael Bayer
On Sep 5, 2010, at 1:27 PM, Freewind wrote: There are two classes: User and Question A user may have many questions, and it also contains a question_count to record the the count of questions belong to him. So, when I add a new question, I want update the question_count of the user. At