Henning Sprang
2015-08-06 10:54:51 UTC
Hi,
I have some data that contains numbers as "Decimal" type instead of plain
int/float - and this makes the automatic json output fail due to a bug in
pythons default json implementation: https://bugs.python.org/issue16535
Being a bit new to bottle I wonder what would be the nicest option to solve
that - ideas so far:
* manually fix all my data to convert Decimal to int/float
* dumping the string myself in the bottle application method and setting
the content type manually to application/json
* use a different json encoder instead of standard python - that might
require to change the autojson output filter, but I don't see where to
start - the tutorial hints to a part of the documentation that I don't see
to find - it's also reported as a bug
https://github.com/bottlepy/bottle/issues/751 - if I get the info here I'd
like to fix that doc issue :)
The latter seems the preferable way - so pointers on where to start or
better ideas welcome ;)
Cheers and thanks in advance,
Henning
--
I have some data that contains numbers as "Decimal" type instead of plain
int/float - and this makes the automatic json output fail due to a bug in
pythons default json implementation: https://bugs.python.org/issue16535
Being a bit new to bottle I wonder what would be the nicest option to solve
that - ideas so far:
* manually fix all my data to convert Decimal to int/float
* dumping the string myself in the bottle application method and setting
the content type manually to application/json
* use a different json encoder instead of standard python - that might
require to change the autojson output filter, but I don't see where to
start - the tutorial hints to a part of the documentation that I don't see
to find - it's also reported as a bug
https://github.com/bottlepy/bottle/issues/751 - if I get the info here I'd
like to fix that doc issue :)
The latter seems the preferable way - so pointers on where to start or
better ideas welcome ;)
Cheers and thanks in advance,
Henning
--
--
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You are member of the "bottlepy" group at google groups.
See http://groups.google.de/group/bottlepy for mailing list options.
See http://bottlepy.org/ for news and documentation.
---
You received this message because you are subscribed to the Google Groups "bottlepy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bottlepy+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.