19 __authors__ = [ |
19 __authors__ = [ |
20 '"Todd Larsen" <tlarsen@google.com>', |
20 '"Todd Larsen" <tlarsen@google.com>', |
21 '"Pawel Solyga" <pawel.solyga@gmail.com>', |
21 '"Pawel Solyga" <pawel.solyga@gmail.com>', |
22 ] |
22 ] |
23 |
23 |
|
24 |
24 from google.appengine.ext import db |
25 from google.appengine.ext import db |
|
26 |
|
27 import polymodel |
25 |
28 |
26 from django.utils.translation import ugettext_lazy |
29 from django.utils.translation import ugettext_lazy |
27 |
30 |
28 from soc.models import base |
|
29 from soc.models import countries |
31 from soc.models import countries |
30 import soc.models.user |
32 import soc.models.user |
31 |
33 |
32 class Group(base.ModelWithFieldAttributes): |
34 class Group(polymodel.PolyModel): |
33 """Common data fields for all groups. |
35 """Common data fields for all groups. |
34 |
|
35 A Group entity participates in the following relationships |
|
36 implemented as a db.ReferenceProperty elsewhere in another db.Model: |
|
37 |
|
38 school), club), sponsor), org) |
|
39 a 1:1 relationship with each entity containing a more specific type of |
|
40 Group. These relationships are represented explicitly in the other |
|
41 "group" models by a db.ReferenceProperty named 'group'. The |
|
42 collection_name argument to db.ReferenceProperty should be set to the |
|
43 singular of the entity model name of the other "group" class. The |
|
44 above relationship names correspond, respectively to these Models: |
|
45 School, Club, Sponsor, Organization |
|
46 The relationships listed here are mutually exclusive. For example, |
|
47 a Group cannot be both a School and a Club at the same time. |
|
48 """ |
36 """ |
49 |
37 |
50 #: Required field storing name of the group. |
38 #: Required field storing name of the group. |
51 name = db.StringProperty(required=True, |
39 name = db.StringProperty(required=True, |
52 verbose_name=ugettext_lazy('Name')) |
40 verbose_name=ugettext_lazy('Name')) |