예제 #1
0
파일: forms.py 프로젝트: Geocent/geonode
 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))
예제 #2
0
파일: forms.py 프로젝트: wpapper/geonode
 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))
예제 #3
0
 def set_end(self, val):
     self.end_time = parse_date_time(val)
예제 #4
0
 def set_start(self, val):
     self.start_time = parse_date_time(val)
예제 #5
0
파일: models.py 프로젝트: Geocent/geonode
 def set_end(self, val):
     self.end_time = parse_date_time(val)
예제 #6
0
파일: models.py 프로젝트: Geocent/geonode
 def set_start(self, val):
     self.start_time = parse_date_time(val)