19 __authors__ = [ |
19 __authors__ = [ |
20 '"Todd Larsen" <tlarsen@google.com>', |
20 '"Todd Larsen" <tlarsen@google.com>', |
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
21 '"Sverre Rabbelier" <sverre@rabbelier.nl>', |
22 ] |
22 ] |
23 |
23 |
|
24 |
24 from google.appengine.ext import db |
25 from google.appengine.ext import db |
25 |
26 |
26 from soc import models |
27 import soc.models.role |
27 import soc.models.person |
|
28 import soc.models.work |
28 import soc.models.work |
29 |
29 |
30 class Documentation(db.Model): |
30 |
31 """Model of Documentation, which is a Work authored by Administrators.""" |
31 class Documentation(soc.models.work.Work): |
32 |
32 """Model of Documentation, which is a Work authored by Administrators. |
33 #: A required 1:1 relationship with a Work entity that contains the |
33 |
34 #: general "work" properties of the Documentation. The |
34 Documentation is items like tax forms, letters from schools confirming |
35 #: back-reference in the Work model is a Query named |
35 enrollment, etc., (often scanned in) that are attached to a Role as |
36 #: 'documentation'. |
36 documentation related to that Role. |
37 #: |
37 |
38 #: work.authors: The Authors of the Work referred to by this |
38 The specific way that some properties and relations inherited from Work |
39 #: relation are the Administrators (or Hosts) creating the |
39 are used with a piece of Documentation are described below. |
40 #: Documentation. |
40 |
41 #: |
41 work.title: The title of the Documentation (e.g. "Verification |
42 #: work.title: The title of the Documentation (e.g. "Verification |
42 of Eligibility"). |
43 #: of Eligibility"). |
43 |
44 #: |
44 work.abstract: Summary of the contents of the 'attachment', or |
45 #: work.abstract: Summary of the contents of the 'attachment', or |
45 just an indication that the required documentation was |
46 #: just an indication that the required documentation was |
46 supplied but is not actually attached. |
47 #: supplied but is not actually attached. |
47 |
48 #: |
48 work.authors: The Authors of the Work referred to by this |
49 #: work.reviews: Annotations to the Documentation made by other |
49 relation are the Administrators (or Hosts) creating the |
50 #: Administrators. |
50 Documentation. |
51 work = db.ReferenceProperty(reference_class=models.work.Work, required=True, |
51 |
52 collection_name="proposal") |
52 work.reviews: Annotations to the Documentation made by other |
|
53 Administrators. |
|
54 """ |
53 |
55 |
54 #: a many:1 relationship of Documentation entities that pertain |
56 #: a many:1 relationship of Documentation entities that pertain |
55 #: to a single Person. The back-reference in the Person model is a |
57 #: to a single Role. The back-reference in the Role model is a |
56 #: Query named 'docs'. |
58 #: Query named 'documentation'. |
57 person = db.ReferenceProperty(reference_class=models.person.Person, |
59 role = db.ReferenceProperty(reference_class=soc.models.role.Role, |
58 collection_name="docs") |
60 collection_name='documentation') |
59 |
61 |
60 #: An optional db.BlobProperty containing the documentation |
62 #: An optional db.BlobProperty containing the documentation |
61 #: (usually a scanned image of a paper document or a PDF file). |
63 #: (usually a scanned image of a paper document or a PDF file). |
62 attachment = db.BlobProperty() |
64 attachment = db.BlobProperty() |
63 |
65 |