Hi Cedk, On Nov 30, 2011, at 7:48 PM, Cédric Krier wrote:
> So I propose to drop this tip and to use the same design as for json-rpc
> which is using a struct for Decimal like this:
>
> {
> '__class__': 'Decimal',
> 'decimal': <value>,
> }
agree
>
> This means that external programs need to be adapted to follow this
> convention. Any way, I think it is better than using float/double for
> Decimal.
agree, but we should provide a JSONEncoder and Decoder class which other
applications (python) could import from trytond.
>
> By the way, I think we could also do the same for date.
yes, both datetime.date and datetime.datetime.
Are you planning to use the isoformat() method on date and datetime ?
If yes, then it makes it convenient to parse from javascript also.
Thanks,
Sharoon Thomas
Director & CEO, Openlabs Technologies & Consulting Pvt Limited
Regd Office: 2J-Skyline Daffodil, Trippunithura - Kochi - IN 682013
Mobile: +1 786 247 1317
http://openlabs.co.in
signature.asc
Description: Message signed with OpenPGP using GPGMail
