| #summary SurveysQuestions relation model |
| #labels Phase-Design,Contents-Skeleton,Design-Model |
| |
| _*Eventually, this topic should be populated by the output of*_ `pydoc`. |
| |
| {{{ |
| class SurveysQuestions(db.Model): |
| """Model to store the many:many relationship between Questions and Surveys. |
| |
| Surveys are "templates" for Reviews. A Question can be re-used in |
| multiple Surveys, and a Survey must contain one or more Questions. |
| For example, even a simple "comment" Survey contains a single Comment |
| "question", with the comment text being the Answer. |
| |
| To obtain all of the Questions in a specific Review: |
| for link in review.questions: |
| question = link.question |
| ... |
| |
| Similarly, for all Reviews that ask a given Question: |
| for link in question.reviews |
| review = link.review |
| ... |
| """ |
| survey = db.ReferenceProperty(reference_class=Survey, |
| collection_name="questions") |
| |
| question = db.ReferenceProperty(reference_class=Question, |
| collection_name="surveys") |
| }}} |
| |
| ---- |
| _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] |