grandlyon: add short reference to formdata in geojson

This commit is contained in:
Frédéric Péters 2017-10-01 11:01:38 +02:00
parent 26b02de6cd
commit fdca4a388a
1 changed files with 1 additions and 0 deletions

View File

@ -31,6 +31,7 @@ for formdef in FormDef.select():
for field in ('numero', 'voie', 'commune', 'message', 'type_probleme'):
feature['properties'][field] = formdata_vars.get('form_var_%s' % field)
feature['properties']['datetime'] = formdata_vars['form_receipt_datetime'].strftime('%d/%m/%Y %H:%M')
feature['properties']['reference'] = '%s:%s' % (formdata_vars['form_slug'], formdata_id)
json.dump(geojson, open(os.path.join(geojson_dir, formdef.url_name + '.json'), 'w'),
indent=2, cls=JSONEncoder)