author | Lennard de Rijk <ljvderijk@gmail.com> |
Thu, 02 Jul 2009 10:46:39 +0200 | |
changeset 2479 | b83c9b1ea0e1 |
parent 2407 | e23fce20ad3a |
permissions | -rw-r--r-- |
2397
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
1 |
#!/usr/bin/python2.5 |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
2 |
# |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
3 |
# Copyright 2009 the Melange authors. |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
4 |
# |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
5 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
6 |
# you may not use this file except in compliance with the License. |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
7 |
# You may obtain a copy of the License at |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
8 |
# |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
9 |
# http://www.apache.org/licenses/LICENSE-2.0 |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
10 |
# |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
11 |
# Unless required by applicable law or agreed to in writing, software |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
12 |
# distributed under the License is distributed on an "AS IS" BASIS, |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
13 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
14 |
# See the License for the specific language governing permissions and |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
15 |
# limitations under the License. |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
16 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
17 |
"""This module contains the GHOP OrgPrizeAssignment Model. |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
18 |
""" |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
19 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
20 |
__authors__ = [ |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
21 |
'"Madhusudan.C.S" <madhusudancs@gmail.com>', |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
22 |
] |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
23 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
24 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
25 |
from google.appengine.ext import db |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
26 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
27 |
import soc.models.base |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
28 |
|
2407
e23fce20ad3a
Changed GHOP module imports to be consistent with rest of Melange code.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
2399
diff
changeset
|
29 |
import soc.modules.ghop.models.organization |
e23fce20ad3a
Changed GHOP module imports to be consistent with rest of Melange code.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
2399
diff
changeset
|
30 |
import soc.modules.ghop.models.program |
2397
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
31 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
32 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
33 |
class GHOPOrgPrizeAssignment(soc.models.base.ModelWithFieldAttributes): |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
34 |
"""Model for prizes assigned to Students by an Organization. |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
35 |
""" |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
36 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
37 |
#: Program to which these winners belong to |
2399
65a83ae32703
Changed imports in models to comply with recent GHOP code move.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2397
diff
changeset
|
38 |
program = db.ReferenceProperty( |
2407
e23fce20ad3a
Changed GHOP module imports to be consistent with rest of Melange code.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
2399
diff
changeset
|
39 |
reference_class=soc.modules.ghop.models.program.GHOPProgram, |
2399
65a83ae32703
Changed imports in models to comply with recent GHOP code move.
Lennard de Rijk <ljvderijk@gmail.com>
parents:
2397
diff
changeset
|
40 |
required=True, collection_name='program_prizes') |
2397
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
41 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
42 |
#: Organization to which these winners belong to |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
43 |
org = db.ReferenceProperty( |
2407
e23fce20ad3a
Changed GHOP module imports to be consistent with rest of Melange code.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
2399
diff
changeset
|
44 |
reference_class=soc.modules.ghop.models.organization.GHOPOrganization, |
2397
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
45 |
required=True, collection_name='organization_prizes') |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
46 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
47 |
#: Ordered list of winners(reference to Student entities) for the given |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
48 |
#: organization under the specified program |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
49 |
winners = db.ListProperty(item_type=db.Key, default=[]) |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
50 |
|
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
51 |
#: Unordered list of runner-ups(reference to Student entities) for the given |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
52 |
#: organization under the specified program |
d943fa182fae
Moved the GHOP module into the modules package.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff
changeset
|
53 |
runner_ups = db.ListProperty(item_type=db.Key, default=[]) |