strasbourg: force some fields to be dates
This commit is contained in:
parent
8802f9eb07
commit
42788dcad5
|
@ -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':
|
||||
|
|
Loading…
Reference in New Issue