# HG changeset patch # User Madhusudan C.S. # Date 1244443333 -7200 # Node ID 6f966e1a80bc5b38e77f9e3c4a819942902766c2 # Parent b9a4609d01e4385291958e43fa0f3600ee53c04c 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 diff -r b9a4609d01e4 -r 6f966e1a80bc 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