wcs : gestion des champs de type date non remplis.
authorProgfou <jean-christophe.andre@auf.org>
Sun, 1 Apr 2012 13:48:36 +0000 (20:48 +0700)
committerProgfou <jean-christophe.andre@auf.org>
Sun, 1 Apr 2012 13:48:36 +0000 (20:48 +0700)
wcs/wcs-extract

index 11d7970..51dee77 100755 (executable)
@@ -140,8 +140,11 @@ def extract_data(formdef, output_directory):
             elif isinstance(field, BoolField):
                 result[field_name] = (data == 'True')
             elif isinstance(field, DateField):
-                result[field_name] = '%04d-%02d-%02d' % (data.tm_year,
+                if isinstance(data, time.struct_time):
+                    result[field_name] = '%04d-%02d-%02d' % (data.tm_year,
                                                     data.tm_mon, data.tm_mday)
+                else:
+                    result[field_name] = data
             elif isinstance(field, FileField):
                 if '.' in data.orig_filename:
                     extension = data.orig_filename.rpartition('.')[2].lower()