Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 292 class FormQuestion(object):
- 293 __storm_table__ = "form_question"
- 294 form_question_id = Int(primary = True,default = AutoReload)
- 295 content = Unicode()
- 296 user_id = Int()
- 297 version = Int()
- 298 question_id = Int()
- 299 status = Unicode()
- 300
- 301 def __init__(self,mlist):
- 302 self.mlist = mlist
- 303 self.database = getConn(mlist)
- 304
- 305 @decfunc
- 306 def recordAnswer(self, addr, question, answer, version):
- 307 """Save the answer for a question of the subscribe form, returning its id."""
- 308 subscriber = Subscriber(self.mlist)
- 310 userID = 1
- 311 status = "pending"
- 312 answer_unicode = answer.decode('utf-8')
- 314 command = "form_question = self.store.add(FormQuestion())\nform_question.content = answer_unicode\nform _question.user_id = userID\nform_question.version = version\nform_question.question_id = question\nform_questio n.status = status\n"
- 318 #form_question_id has autoreload set, its value will be serially updated in database
- 319 self.user_id = userID
- 320 self.content = answer_unicode
- 321 self.version = version
- 322 self.question_id = question
- 323 self.store.add(self)
- 324 formQuestionID = self.store.find(FormQuestion).max(FormQuestion.form_question_id)
- 327 return formQuestionID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement