diff --git a/strasbourg/reprise.py b/strasbourg/reprise.py index 9ea2691..721ae1e 100644 --- a/strasbourg/reprise.py +++ b/strasbourg/reprise.py @@ -136,6 +136,10 @@ def process_children(node): if len(field_node.findall('choices/choice')) > 1: field_type = 'items' + label = fix_encoding(field_node.find('label').attrib['plain']) + if field_type == 'textinput': + if label.startswith('Date ') and not label.startswith('Date et heure'): + field_type = 'date' field_klass = { 'textinput': fields.StringField, @@ -149,8 +153,7 @@ def process_children(node): 'fileupload': fields.FileField, }[field_type] - field = field_klass(id=str(field_id), type=field_klass.key, - label=fix_encoding(field_node.find('label').attrib['plain'])) + field = field_klass(id=str(field_id), type=field_klass.key, label=label) formdef.fields.append(field) if field_type == 'checkbox':