blob: 401cbaa247cc7efbcb6b7d9917843e2316f62315 [file] [log] [blame]
#summary Survey entity model
#labels Phase-Design,Contents-Skeleton,Design-Model
_*Eventually, this topic should be populated by the output of*_ `pydoc`.
{{{
class Survey(db.Model):
"""Model of an authored "template" for Reviews of Proposals and other Works.
A Survey is a Work made up of one or more Questions. (The Answers to
a specific instance of an "answered Survey" are stored in a separate model
called a Review.)
Surveys are even used as templates for comments and scoring annotations
to various Works, such as Proposals. See the Review model for specific
examples.
A Survey entity participates in a number of relationships:
work) a required 1:1 relationship with a Work entity that contains the
general "work" properties of the Survey. The back-reference in the Work
model is a Query named 'survey'.
work.authors: the Authors of the Work referred to by this relation
are the authors of the Survey of questions and potential answers.
work.title: the title of the Survey, used to help identify the
Survey when seeking a "template" for creating a specific Review.
work.abstract: displayed before the first Question in the Survey,
usually explanatory text.
work.reviews: even Surveys can be "reviewed" (possibly commented on
during creation or annotated once put into use).
questions) a required many:many relationship (many:many because a given
Question can be reused in more than one Survey) between Question entities
and, when combined, the Survey they form. See the SurveysQuestions
model for details. Using entities of the SurveyQuestions model to
related a given Question to a particular Survey, that Question can only
be asked once in a given Survey. Asking the same exact question more
than once does not seem like a common use case.
reviews) a many:1 relationship with Review entities that indicate they
contain specific Answers to each of the Questions associated with the
particular Survey. This relation is implemented as the 'reviews'
back-reference Query of the Review model 'survey' reference.
"""
work = db.ReferenceProperty(reference_class=Work, required=True,
collection_name="survey")
}}}
----
_Copyright 2008 Google Inc._
_This work is licensed under a_
[http://soc.googlecode.com/svn/wiki/html/licenses/cc-by-attribution-2_5.html Creative Commons Attribution 2.5 License].
[http://creativecommons.org/licenses/by/2.5/ http://soc.googlecode.com/svn/wiki/html/licenses/cc-by-2_5-88x31.png]