| #summary Answer entity model |
| #labels Phase-Design,Contents-Skeleton,Design-Model |
| |
| _*Eventually, this topic should be populated by the output of*_ `pydoc`. |
| |
| {{{ |
| class Answer(db.Model): |
| """Model of a specific Answer to a Question in a specific Review. |
| |
| An Answer entity participates in a number of relationships: |
| |
| question) a required many:1 relationship, where each of many Answers is |
| a specific answer to a single Question. An Answer must always be |
| associated with a Question in order to be interpreted. |
| |
| The back-reference in the Question model is a Query named 'answers'. It |
| is currently unclear how useful this back-reference will be, since the |
| same question could be used in multiple different Review "templates". |
| Given this, 'answers' currently only exists for completeness. |
| |
| review) a required many:1 relationship, where each of many Answers to |
| different Questions represents the answer set of a specific Review. |
| The back-reference in the Review model is a Query named 'answers' which |
| represents all of the specific answers to questions in that Review. |
| |
| short: db.StringProperty storing the "short" answer to the question; |
| the interpretation of this value depends on the Question entity |
| referred to by 'question'. Answers can be indexed, filtered, and |
| sorted by their "short" answer. Depending on the Question type, some |
| Answers will use only 'short', some only 'long', and some both. |
| |
| long: db.TextProperty storing the "long" answer to the question; the |
| interpretation of this value depends on the Question entity referred |
| to by 'question'. |
| |
| picks: db.ListProperty of short strings from the list of possible |
| picks in the question.pick_choices list. |
| """ |
| question = db.ReferenceProperty(reference_class=Question, required=True, |
| collection_name="answers") |
| |
| review = db.ReferenceProperty(reference_class=Review, required=True, |
| collection_name="answers") |
| |
| short = db.StringProperty() |
| long = db.TextProperty() |
| picks = db.ListProperty(item_type=str) |
| }}} |
| |
| ---- |
| _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] |