The Survey application models
A common place to start development of a new Django application is with the models: the basic building blocks of data that are going to be manipulated and stored by the application. A cornerstone model for our example market research survey
application will be the Survey
model.
A Survey
is going to be similar to the Django tutorial Poll
model, except that:
Where the tutorial
Poll
only contains one question, aSurvey
will have multiple questions.A
Survey
will have a title for reference purposes. For the tutorialPoll
, a single question could be used for this.A
Survey
will only be open for responses for a limited (and variable, depending on theSurvey
instance) time. While thePoll
model has apub_date
field, it is not used for anything other than orderingPolls
on the index page. Thus,Survey
will need two date fields wherePoll
has only one, and theSurvey
date fields will be used more than thePoll pub_date
field is used.
Given just these few simple requirements...