anxiousmodernman/smartsurvey — Issue #2: Create SurveyAnswer() class to model survey answers
Author: anxiousmodernman
Created: 2011-10-24 18:58:05+00:00
State: open

(01:21:25 PM) Jeff May: I think we need to create a SurveyAnswer class
(01:22:02 PM) Jeff May: class SurveyAnswer(BaseModel):
def __init__(self):
self.id = None
self.content = ''

(01:23:00 PM) Jeff May: then SurveyResponse will have:

def __init__(self):
...
self.answers = [] # instead of {}

(01:23:46 PM) Jeff May: that way when we are entering it into the database, it works the same way as every other model...

if model.id is None:
# create a new id for it
(01:24:21 PM) Jeff May: and then when we retrieve it, we just set the id from the database
(01:27:17 PM) Jeff May: ... err, this still leaves something out

class SurveyAnswer(BaseModel):
def __init__(self):
self.id = None
self.content = ''
self.text = ?