app/soc/models/student_proposal.py
changeset 1412 fa274dd2f476
child 1421 7602d41f0ed8
equal deleted inserted replaced
1411:92ced55eb16f 1412:fa274dd2f476
       
     1 #!/usr/bin/python2.5
       
     2 #
       
     3 # Copyright 2009 the Melange authors.
       
     4 #
       
     5 # Licensed under the Apache License, Version 2.0 (the "License");
       
     6 # you may not use this file except in compliance with the License.
       
     7 # You may obtain a copy of the License at
       
     8 # 
       
     9 #   http://www.apache.org/licenses/LICENSE-2.0
       
    10 # 
       
    11 # Unless required by applicable law or agreed to in writing, software
       
    12 # distributed under the License is distributed on an "AS IS" BASIS,
       
    13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    14 # See the License for the specific language governing permissions and
       
    15 # limitations under the License.
       
    16 
       
    17 """This module contains the Student Proposal Model."""
       
    18 
       
    19 __authors__ = [
       
    20   '"Lennard de Rijk" <ljvderijk@gmail.com>',
       
    21 ]
       
    22 
       
    23 
       
    24 from google.appengine.ext import db
       
    25 
       
    26 from django.utils.translation import ugettext
       
    27 
       
    28 import soc.models.linkable
       
    29 import soc.models.mentor
       
    30 import soc.models.organization
       
    31 import soc.models.program
       
    32 
       
    33 
       
    34 class StudentProposal(soc.models.linkable.Linkable):
       
    35   """Model for a student proposal used in the GSoC workflow.
       
    36   """
       
    37 
       
    38   #: Required field indicating the "title" of the proposal
       
    39   title = db.StringProperty(required=True,
       
    40       verbose_name=ugettext('Title'))
       
    41   title.help_text = ugettext(
       
    42       'title of the proposal')
       
    43 
       
    44   #: optional, indexed plain text field used for different purposes,
       
    45   #: depending on the specific type of the work
       
    46   abstract = db.StringProperty(multiline=True)
       
    47   abstract.help_text = ugettext(
       
    48       'short abstract, summary, or snippet;'
       
    49       ' 500 characters or less, plain text displayed publicly')
       
    50 
       
    51   #: an URL linking to more information about this students proposal
       
    52   additional_info = db.URLProperty(required=False)
       
    53   additional_info.help_text = ugettext(
       
    54       'Link to a resource containing more information about your proposal')
       
    55 
       
    56   #: A property containing which mentor has assigned himself to this proposal
       
    57   #: Only a proposal with an assigned mentor can be turned into a accepted proposal
       
    58   #: A proposal can only have one mentor
       
    59   mentor = db.ReferenceProperty(reference_class=soc.models.mentor.Mentor,
       
    60                               required=False, collection_name='student_proposals')
       
    61 
       
    62   #: the current score of this proposal, used to determine which proposals
       
    63   #: should be assigned a project slot.
       
    64   score = db.IntegerProperty(required=True, default=0)
       
    65 
       
    66   #: the status of this proposal
       
    67   #: pending: the proposal is in the process of being ranked/scored
       
    68   #: accepted: the proposal has been assigned a project slot
       
    69   #: rejected: the proposal has not been assigned a slot or the organization
       
    70   #: does not want this proposal.
       
    71   #: invalid: the student or developer marked this as an invalid proposal.
       
    72   status = db.StringProperty(required=True, default='pending',
       
    73       choices=['pending','accepted', 'rejected', 'invalid'])
       
    74 
       
    75   #: organization to which this proposal is directed
       
    76   org = db.ReferenceProperty(reference_class=soc.models.organization.Organization,
       
    77                               required=True, collection_name='student_proposals')
       
    78 
       
    79   #: program in which this proposal has been created
       
    80   program = db.ReferenceProperty(reference_class=soc.models.program.Program,
       
    81                               required=True, collection_name='student_proposals')
       
    82 
       
    83   #: date when the proposal was created
       
    84   created_on = db.DateTimeProperty(required=True, auto_now_add=True)
       
    85 
       
    86   #: date when the proposal was last modified, should be set manually on edit
       
    87   modified_on = db.DateTimeProperty(required=True, auto_now_add=True)