Exemplo n.º 1
0
 def _convert_time(self, key):
     val = self.data.get(key, None)
     if not val: return
     numeric = None
     # the client will send things back as ints
     if self.form_mode == 'client':
         try:
             numeric = int(val)
         except ValueError:
             pass
     # otherwise, parse as formatted strings
     if not numeric:
         err = None
         parsed = None
         try:
             parsed = parse_date_time(val)
         except ValueError, e:
             err = str(e)
         if val is not None and parsed is None:
             err = 'Unable to read as date : %s, please format as yyyy-mm-dd' % val
         if err:
             self._my_errors[key] = err
         if parsed:
             numeric = int(datetime_to_seconds(parsed))
Exemplo n.º 2
0
 def _convert_time(self, key):
     val = self.data.get(key, None)
     if not val: return
     numeric = None
     # the client will send things back as ints
     if self.form_mode == 'client':
         try:
             numeric = int(val)
         except ValueError:
             pass
     # otherwise, parse as formatted strings
     if not numeric:
         err = None
         parsed = None
         try:
             parsed = parse_date_time(val)
         except ValueError, e:
             err = str(e)
         if val is not None and parsed is None:
             err = 'Unable to read as date : %s, please format as yyyy-mm-dd' % val
         if err:
             self._my_errors[key] = err
         if parsed:
             numeric = int(datetime_to_seconds(parsed))
Exemplo n.º 3
0
 def set_end(self, val):
     self.end_time = parse_date_time(val)
Exemplo n.º 4
0
 def set_start(self, val):
     self.start_time = parse_date_time(val)
Exemplo n.º 5
0
 def set_end(self, val):
     self.end_time = parse_date_time(val)
Exemplo n.º 6
0
 def set_start(self, val):
     self.start_time = parse_date_time(val)