Changed the property that holds the minimum age required for Students to participate in a GHOP based program.
authorMadhusudan C.S. <madhusudancs@gmail.com>
Mon, 08 Jun 2009 08:42:13 +0200
changeset 2406 6f966e1a80bc
parent 2405 b9a4609d01e4
child 2407 e23fce20ad3a
Changed the property that holds the minimum age required for Students to participate in a GHOP based program. Added a new property student_min_age_as_of to hold the DateTime from when the minimum age should be reached. Changed student_min_age property to now store the student minimum age as an integer. This all feel more user friendly then letting the program admin calculate the required DateTime. Storing the two properties is then still needed in this case since information might be lost otherwise when the program admin brings up the edit view. Reviewed by: Lennard de Rijk
app/soc/modules/ghop/models/program.py
--- a/app/soc/modules/ghop/models/program.py	Sat Jun 06 20:40:08 2009 +0200
+++ b/app/soc/modules/ghop/models/program.py	Mon Jun 08 08:42:13 2009 +0200
@@ -33,11 +33,21 @@
   """GHOP Program model extends the basic Program model.
   """
 
-  #: Property that contains the latest date of birth before which a Student
-  #: can participate
-  student_min_age = db.DateTimeProperty(required=False)
+  #: Property that contains the minimum age of a student allowed to
+  #: participate
+  student_min_age = db.IntegerProperty(
+      required=True, verbose_name=ugettext('Student minimum age'))
   student_min_age.help_text = ugettext(
-      'Minimum age of the student to sign-up. Given by the latest birthdate allowed')
+      'Minimum age of the student to sign-up in years.')
+
+  #: Property that contains the date as of which above student
+  #: minimum age requirement holds. This is a DateTimeProperty because
+  #: programs might run in a different timezone then the Appengine Server
+  #: is running on.
+  student_min_age_as_of = db.DateTimeProperty(
+      required=True, verbose_name=ugettext('Minimum age as of'))
+  student_min_age_as_of.help_text = ugettext(
+      'Date as of which the student minimum age requirement holds.')
 
   #: Required property containing the number of Tasks Students can work
   #: on simultaneously. For GHOP it is 1