24 |
24 |
25 from google.appengine.ext import db |
25 from google.appengine.ext import db |
26 |
26 |
27 import soc.models.base |
27 import soc.models.base |
28 |
28 |
29 import ghop.models.organization |
29 from soc.modules.ghop.models import organization as ghop_organization_model |
30 import ghop.models.program |
30 from soc.modules.ghop.models import program as ghop_program_model |
31 |
31 |
32 |
32 |
33 class GHOPOrgPrizeAssignment(soc.models.base.ModelWithFieldAttributes): |
33 class GHOPOrgPrizeAssignment(soc.models.base.ModelWithFieldAttributes): |
34 """Model for prizes assigned to Students by an Organization. |
34 """Model for prizes assigned to Students by an Organization. |
35 """ |
35 """ |
36 |
36 |
37 #: Program to which these winners belong to |
37 #: Program to which these winners belong to |
38 program = db.ReferenceProperty(reference_class=ghop.models.program.GHOPProgram, |
38 program = db.ReferenceProperty( |
39 required=True, |
39 reference_class=ghop_program_model.GHOPProgram, |
40 collection_name='program_prizes') |
40 required=True, collection_name='program_prizes') |
41 |
41 |
42 #: Organization to which these winners belong to |
42 #: Organization to which these winners belong to |
43 org = db.ReferenceProperty( |
43 org = db.ReferenceProperty( |
44 reference_class=ghop.models.organization.GHOPOrganization, |
44 reference_class=ghop_organization_model.GHOPOrganization, |
45 required=True, collection_name='organization_prizes') |
45 required=True, collection_name='organization_prizes') |
46 |
46 |
47 #: Ordered list of winners(reference to Student entities) for the given |
47 #: Ordered list of winners(reference to Student entities) for the given |
48 #: organization under the specified program |
48 #: organization under the specified program |
49 winners = db.ListProperty(item_type=db.Key, default=[]) |
49 winners = db.ListProperty(item_type=db.Key, default=[]) |