Changed imports in models to comply with recent GHOP code move.
[Melange.git] / app / soc / modules / ghop / models / work_submission.py
blob9899e12380ebf048e6806d88ee6c8af8677533bc
1 #!/usr/bin/python2.5
3 # Copyright 2009 the Melange authors.
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 """This module contains the GHOP WorkSubmission Model.
18 """
20 __authors__ = [
21 '"Madhusudan.C.S" <madhusudancs@gmail.com>',
22 '"Lennard de Rijk" <ljvderijk@gmail.com>',
26 from google.appengine.ext import db
28 from django.utils.translation import ugettext
30 import soc.models.linkable
31 import soc.models.user
33 from soc.modules.ghop.models import program as ghop_program_model
34 from soc.modules.ghop.models import task as task_model
37 class GHOPWorkSubmission(soc.models.linkable.Linkable):
38 """Model for work submissions for a task by students.
40 Scope will be set to the Organization to which this work has been submitted.
41 """
43 #: Task to which this work was submitted
44 task = db.ReferenceProperty(reference_class=task_model.GHOPTask,
45 required=True,
46 collection_name='work_submissions')
48 #: User who submitted this work
49 user = db.ReferenceProperty(reference_class=soc.models.user.User,
50 required=True,
51 collection_name='work_submissions')
53 #: Program to which this work belongs to
54 program = db.ReferenceProperty(
55 reference_class=ghop_program_model.GHOPProgram,
56 required=True, collection_name='work_submissions')
58 #: Property allowing you to store information about your work
59 information = db.TextProperty(
60 required=True, verbose_name=ugettext('Info'))
61 information.help_text = ugettext(
62 'Information about the work you submit for this task')
64 #: Property containing an URL to this work or more information about it
65 url_to_work = db.LinkProperty(
66 required=False, verbose_name=ugettext('URL to your Work'))
67 url_to_work.help_text = ugettext(
68 'URL to a resource containing your work or more information about it')
70 #: Property containing the date when the work was submitted
71 submitted_on = db.DateTimeProperty(required=True, auto_now_add=True,
72 verbose_name=ugettext('Submitted on'))