app/ghop/models/org_prize_assignment.py
author Lennard de Rijk <ljvderijk@gmail.com>
Thu, 04 Jun 2009 20:21:15 +0200
changeset 2382 3a6302dd346b
parent 2355 5c4a9ffec300
permissions -rw-r--r--
Added link to edit the Document on the Document's public page. This link will only show if the user is allowed to edit the document. Fixes issue 271. Update issue 271 Owner: ljvderijk
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2347
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
     2
#
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
     3
# Copyright 2009 the Melange authors.
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
     4
#
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
     8
#
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    10
#
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    16
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    17
"""This module contains the GHOP PrizePerOrg Model.
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    18
"""
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    19
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    20
__authors__ = [
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    21
  '"Madhusudan.C.S" <madhusudancs@gmail.com>',
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    22
]
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    23
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    24
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    25
from google.appengine.ext import db
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    26
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    27
import soc.models.base
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    28
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    29
import ghop.models.organization
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    30
import ghop.models.program
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    31
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    32
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    33
class GHOPOrgPrizeAssignment(soc.models.base.ModelWithFieldAttributes):
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    34
  """Model for prizes assigned to Students by an Organization.
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    35
  """
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    36
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    37
  #: Program to which these winners belong to
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    38
  program = db.ReferenceProperty(reference_class=ghop.models.program.GHOPProgram,
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    39
                                 required=True,
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    40
                                 collection_name='program_prizes')
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    41
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    42
  #: Organization to which these winners belong to
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    43
  org = db.ReferenceProperty(
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    44
      reference_class=ghop.models.organization.GHOPOrganization,
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    45
      required=True, collection_name='organization_prizes')
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    46
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    47
  #: Ordered list of winners(reference to Student entities) for the given
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    48
  #: organization under the specified program
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    49
  winners = db.ListProperty(item_type=db.Key, default=[])
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    50
2355
5c4a9ffec300 Fixed typo in org_prize_assignment model.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 2347
diff changeset
    51
  #: Unordered list of runner-ups(reference to Student entities) for the given
2347
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    52
  #: organization under the specified program
c5a397f57d65 Added several models related to the GHOP workflow.
Madhusudan C.S. <madhusudancs@gmail.com>
parents:
diff changeset
    53
  runner_ups = db.ListProperty(item_type=db.Key, default=[])