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 |
25 import polymodel |
|
26 |
|
27 from google.appengine.ext import db |
25 from google.appengine.ext import db |
28 |
26 |
29 from django.utils.translation import ugettext_lazy |
27 from django.utils.translation import ugettext_lazy |
30 |
28 |
|
29 import soc.models.linkable |
31 import soc.models.user |
30 import soc.models.user |
32 |
31 |
33 |
32 |
34 class Work(polymodel.PolyModel): |
33 class Work(soc.models.linkable.Linkable): |
35 """Model of a Work created by one or more Persons in Roles. |
34 """Model of a Work created by one or more Persons in Roles. |
36 |
35 |
37 Work is a "base entity" of other more specific "works" created by Persons |
36 Work is a "base entity" of other more specific "works" created by Persons |
38 serving in "roles". |
37 serving in "roles". |
39 |
38 |
54 #: can be indexed, filtered, and sorted by 'title'. |
53 #: can be indexed, filtered, and sorted by 'title'. |
55 title = db.StringProperty(required=True, |
54 title = db.StringProperty(required=True, |
56 verbose_name=ugettext_lazy('Title')) |
55 verbose_name=ugettext_lazy('Title')) |
57 title.help_text = ugettext_lazy( |
56 title.help_text = ugettext_lazy( |
58 'title of the document; often used in the window title') |
57 'title of the document; often used in the window title') |
59 |
|
60 #: Required path, prepended to a "link ID" to form the document URL. |
|
61 #: The combined path and link ID must be globally unique on the |
|
62 #: site. Except in /site/document (Developer) forms, this field is not |
|
63 #: usually directly editable by the User, but is instead set by controller |
|
64 #: logic to match the "scope" of the document. |
|
65 scope_path = db.StringProperty(required=True, |
|
66 verbose_name=ugettext_lazy('Scope path')) |
|
67 scope_path.help_text = ugettext_lazy( |
|
68 'path portion of URLs, prepended to link ID') |
|
69 |
|
70 #: Required link ID, appended to a "path" to form the document URL. |
|
71 #: The combined path and link ID must be globally unique on the |
|
72 #: site (but, unlike some link IDs, a Work link ID can be reused, |
|
73 #: as long as the combination with the preceding path is unique). |
|
74 link_id = db.StringProperty(required=True, |
|
75 verbose_name=ugettext_lazy('Link ID')) |
|
76 link_id.help_text = ugettext_lazy('link ID used in URLs') |
|
77 |
58 |
78 #: short name used in places such as the sidebar menu and breadcrumb trail |
59 #: short name used in places such as the sidebar menu and breadcrumb trail |
79 #: (optional: title will be used if short_name is not present) |
60 #: (optional: title will be used if short_name is not present) |
80 short_name = db.StringProperty(verbose_name=ugettext_lazy('Short name')) |
61 short_name = db.StringProperty(verbose_name=ugettext_lazy('Short name')) |
81 short_name.help_text = ugettext_lazy( |
62 short_name.help_text = ugettext_lazy( |