Django 1.8 - django 1.7 differences to read DecimalField

88 views
Skip to first unread message

Maximiliano Robaina

unread,
Apr 5, 2017, 5:57:03 PM4/5/17
to Django developers (Contributions to Django itself)
Hi,


I'm the maintener of django-firebird database backend.

I've an strange behavior (a different result) when reading a value from a DecimalField between Django 1.7 and Django 1.8 and I'm trying to figured out where is my mistake.

I've a django project which I update from 1.7 to 1.8.
In this project I've a model with a DecimalField.  (by example, price = DecimalField(max_digits=18, decimal_places=2)

Then, in django 1.7

>> obj = ModelWithDecimalField.objects.first()
>> obj.price
>>  Decimal("1990.00")

In django 1.8

>> obj = ModelWithDecimalField.objects.first()
>> obj.price
>>  Decimal("1990")


So, I don't know where look to found this change. What change between 1.7 and 1.8
Maybe I forget to implement something in django-firebird 1.8


Thanks in advance
Maxi






Tim Graham

unread,
Apr 5, 2017, 7:27:11 PM4/5/17
to Django developers (Contributions to Django itself)
I'd suggest to use git bisect to find the Django commit where the behavior changed:
https://docs.djangoproject.com/en/dev/internals/contributing/triaging-tickets/#bisecting-a-regression

Maximiliano Robaina

unread,
Apr 6, 2017, 9:41:05 AM4/6/17
to Django developers (Contributions to Django itself)
Hi Tim,

Thanks for the tip.

I finally found the problem [1], which was obviously between the chair and the keyboard.

Regards.
Maxi

Reply all
Reply to author
Forward
0 new messages