Bug #11088
sérialisation d'un schéma vs date option
Start date:
27 May 2016
Due date:
% Done:
0%
Estimated time:
Patch proposed:
Yes
Planning:
Description
Dans un formulaire qui a un champ option (tiré de workflow) avec des dates, ça donne ça lors de la sérialisation en dictionnaire :
'options': {'date_fin_paiement': time.struct_time(tm_year=2016, tm_mon=6, tm_mday=14, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=1, tm_yday=166, tm_isdst=-1), 'date_fin': time.struct_time(tm_year=2016, tm_mon=6, tm_mday=9, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=161, tm_isdst=-1),
et rapidement derrière,
Exception: type = '<type 'exceptions.TypeError'>', value = 'time.struct_time(tm_year=2016, tm_mon=6, tm_mday=14, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=1 , tm_yday=166, tm_isdst=-1) is not JSON serializable'
Files
Associated revisions
History
Updated by Frédéric Péters almost 7 years ago
- File 0001-formdef-use-custom-json-encoder-for-schema-export-11.patch 0001-formdef-use-custom-json-encoder-for-schema-export-11.patch added
- Status changed from Nouveau to En cours
- Patch proposed changed from No to Yes
Updated by Thomas Noël over 6 years ago
Ack.
Juste pour ma gouverne :
json.loads(formdef.export_to_json())['options']['foo'].startswith('2016-04')c'est lié au soucis de timezone ?
Updated by Frédéric Péters over 6 years ago
Thomas Noël a écrit :
Juste pour ma gouverne :
[...] c'est lié au soucis de timezone ?
Oui, c'est en attendant #9876.
Updated by Frédéric Péters over 6 years ago
- Status changed from En cours to Résolu (à déployer)
commit 88380bc58e997c4bd63cc251401c7da565756244 Author: Frédéric Péters <fpeters@entrouvert.com> Date: Fri Jun 17 20:14:26 2016 +0200 formdef: use custom json encoder for schema export (#11088)
formdef: use custom json encoder for schema export (#11088)