#15766: select_related() changes type of DecimalField -------------------------------------+------------------------------------- Reporter: CarstenF | Owner: nobody Type: Bug | Status: closed Milestone: | Component: Database layer Version: 1.3 | (models, ORM) Resolution: | Severity: Normal worksforme | Keywords: Triage Stage: | Has patch: 0 Unreviewed | Needs tests: 0 Needs documentation: 0 | Easy pickings: 0 Patch needs improvement: 0 | -------------------------------------+------------------------------------- Changes (by lukeplant):
* status: new => closed * needs_better_patch: => 0 * component: Uncategorized => Database layer (models, ORM) * needs_tests: => 0 * easy: => 0 * needs_docs: => 0 * resolution: => worksforme Comment: I can't reproduce this. I'm using Oracle 10g Express Edition, instantclient 11.2. I tested with Python 2.5 and Python 2.6, Django trunk, and got the following results: {{{ In [1]: import decimal In [2]: from ticket15766.models import * In [3]: c = Code(grenzwert=decimal.Decimal('10.00'), id=1) In [4]: c.save() In [5]: e = Erfasst(code=c) In [6]: e.save() In [7]: Erfasst.objects.get(id=1).code.grenzwert Out[7]: Decimal("10.00") In [8]: Erfasst.objects.select_related().get(id=1).code.grenzwert Out[8]: Decimal("10") In [9]: type(Erfasst.objects.select_related().get(id=1).code.grenzwert) Out[9]: <class 'decimal.Decimal'> }}} If you can provide enough info for us to reproduce it, please do so and re-open this ticket. Also, I notice that in my results, the value `Decimal("10")` given with `select_related()` is strictly speaking different from `Decimal("10.00")`. I don't have enough experience with Decimal to know if this is a material difference in itself. If it is, then you could re-open on that basis too. But the info to track down your exact problem would probably be useful anyway. -- Ticket URL: <http://code.djangoproject.com/ticket/15766#comment:1> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.