app/soc/modules/ghop/models/work_submission.py
changeset 2845 99121cc7181d
parent 2821 21dd1ee785f5
equal deleted inserted replaced
2844:ec22622da589 2845:99121cc7181d
    25 
    25 
    26 from google.appengine.ext import db
    26 from google.appengine.ext import db
    27 
    27 
    28 from django.utils.translation import ugettext
    28 from django.utils.translation import ugettext
    29 
    29 
    30 import soc.models.linkable
    30 import soc.models.base
    31 import soc.models.user
    31 import soc.models.user
    32 
    32 
       
    33 from soc.modules.ghop.models import organization as ghop_org_model
    33 from soc.modules.ghop.models import program as ghop_program_model
    34 from soc.modules.ghop.models import program as ghop_program_model
    34 from soc.modules.ghop.models import task as task_model
    35 from soc.modules.ghop.models import task as task_model
    35 
    36 
    36 
    37 
    37 class GHOPWorkSubmission(soc.models.linkable.Linkable):
    38 class GHOPWorkSubmission(soc.models.base.ModelWithFieldAttributes):
    38   """Model for work submissions for a task by students.
    39   """Model for work submissions for a task by students.
    39 
    40 
    40   Scope will be set to the Organization to which this work has been submitted.
    41   Scope will be set to the Organization to which this work has been submitted.
    41   scope_path will be set to the task key name under which this work was
    42   scope_path will be set to the task key name under which this work was
    42   submitted.
    43   submitted.
    44 
    45 
    45   #: User who submitted this work
    46   #: User who submitted this work
    46   user = db.ReferenceProperty(reference_class=soc.models.user.User,
    47   user = db.ReferenceProperty(reference_class=soc.models.user.User,
    47                               required=True,
    48                               required=True,
    48                               collection_name='work_submissions')
    49                               collection_name='work_submissions')
       
    50 
       
    51   #: Organization to which this work belongs to
       
    52   org = db.ReferenceProperty(
       
    53       reference_class=ghop_org_model.GHOPOrganization,
       
    54       required=True, collection_name='work_submissions')
    49 
    55 
    50   #: Program to which this work belongs to
    56   #: Program to which this work belongs to
    51   program = db.ReferenceProperty(
    57   program = db.ReferenceProperty(
    52       reference_class=ghop_program_model.GHOPProgram,
    58       reference_class=ghop_program_model.GHOPProgram,
    53       required=True, collection_name='work_submissions')
    59       required=True, collection_name='work_submissions')