benoitc/couchdbkit

Strange Decimal behaviour in ListProperty

janua opened this issue · 0 comments

>>> from decimal import Decimal
>>> from couchdbkit import *
>>> class A(Document):
...     prices = ListProperty()
...     
>>> a = A()
>>> a.prices.append(Decimal('22.44'))
>>> a.prices.append(Decimal('67.87'))
>>> a.prices.append(Decimal('22.44'))
>>> a.prices
[u'22.44', Decimal('67.87'), u'22.44']

Why is a Decimal with 22.44 coming up as unicode, and other Decimals with different values coming up as the actual object? I have tried to use item_type property, but this does help anything.
This isn't consistent behaviour!