app/soc/models/timeline.py
author Lennard de Rijk <ljvderijk@gmail.com>
Wed, 28 Jan 2009 15:33:53 +0000
changeset 1041 dfe21b16c86c
parent 970 8b5611d5b053
child 1307 091a21cf3627
permissions -rw-r--r--
Added default values to the User model. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
764
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     1
#!/usr/bin/python2.5
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     2
#
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     3
# Copyright 2008 the Melange authors.
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     4
#
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     5
# Licensed under the Apache License, Version 2.0 (the "License");
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     6
# you may not use this file except in compliance with the License.
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     7
# You may obtain a copy of the License at
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     8
#
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
     9
#   http://www.apache.org/licenses/LICENSE-2.0
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    10
#
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    11
# Unless required by applicable law or agreed to in writing, software
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    12
# distributed under the License is distributed on an "AS IS" BASIS,
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    13
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    14
# See the License for the specific language governing permissions and
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    15
# limitations under the License.
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    16
771
0b1beae179f5 Typo and style fixes.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 766
diff changeset
    17
"""This module contains the Timeline Model.
0b1beae179f5 Typo and style fixes.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 766
diff changeset
    18
"""
764
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    19
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    20
__authors__ = [
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    21
  '"Sverre Rabbelier" <sverre@rabbelier.nl>',
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    22
]
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    23
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    24
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    25
from google.appengine.ext import db
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    26
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 776
diff changeset
    27
from django.utils.translation import ugettext
764
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    28
766
046b4b51eabf Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents: 765
diff changeset
    29
from soc.models import base
764
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    30
766
046b4b51eabf Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents: 765
diff changeset
    31
046b4b51eabf Made Program reference Timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents: 765
diff changeset
    32
class Timeline(base.ModelWithFieldAttributes):
764
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    33
  """The Timeline Model, representing the timeline for a Program.
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    34
  """
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    35
776
f86a76f52bf4 Started on edit timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents: 771
diff changeset
    36
  scope_path = db.StringProperty(required=True,
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 776
diff changeset
    37
      verbose_name=ugettext('Scope Path'))
776
f86a76f52bf4 Started on edit timeline
Sverre Rabbelier <srabbelier@gmail.com>
parents: 771
diff changeset
    38
771
0b1beae179f5 Typo and style fixes.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 766
diff changeset
    39
  program_start = db.DateTimeProperty(
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 776
diff changeset
    40
      verbose_name=ugettext('Program Start date'))
764
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    41
771
0b1beae179f5 Typo and style fixes.
Lennard de Rijk <ljvderijk@gmail.com>
parents: 766
diff changeset
    42
  program_end = db.DateTimeProperty(
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 776
diff changeset
    43
      verbose_name=ugettext('Program End date'))
764
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    44
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    45
  org_signup_start = db.DateTimeProperty(
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 776
diff changeset
    46
      verbose_name=ugettext('Organization Signup Start date'))
764
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    47
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    48
  org_signup_end  = db.DateTimeProperty(
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 776
diff changeset
    49
      verbose_name=ugettext('Organization Signup End date'))
764
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    50
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    51
  student_signup_start  = db.DateTimeProperty(
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 776
diff changeset
    52
      verbose_name=ugettext('Student Signup Start date'))
764
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    53
e0293fa7b342 Added a basic Timeline model
Sverre Rabbelier <srabbelier@gmail.com>
parents:
diff changeset
    54
  student_signup_end = db.DateTimeProperty(
970
8b5611d5b053 Use ugettext instead of ugettext_lazy
Sverre Rabbelier <srabbelier@gmail.com>
parents: 776
diff changeset
    55
      verbose_name=ugettext('Student Signup End date'))