def saveField(self, fieldName): if fieldName == 'is_special': setattr(self.obj, fieldName, valueToBool(self[fieldName])) elif fieldName == 'wday': pass elif fieldName == 'timeofday': timeofday = self['timeofday'] if not ':' in timeofday: timeofday += ':00' if len(timeofday) < 5: timeofday = '0' + timeofday timeString = '%s %s' % (self['wday'], timeofday) time = TutorialTime(timeString) setattr(self.obj, 'time', time) else: ObjectForm.saveField(self, fieldName)
def load_time(self, value): return TutorialTime(str(value))