Changes between Initial Version and Version 2 of Ticket #23320
- Timestamp:
- Aug 20, 2014, 2:33:07 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23320
- Property Cc added
- Property Type Uncategorized → Cleanup/optimization
-
Ticket #23320 – Description
initial v2 2 2 3 3 Is the behaviour outlined in this snippet expected: 4 https://dpaste.de/BAck 4 {{{#!python 5 # models.py 6 from django.db import models 7 8 class Fl(models.Model): 9 10 float = models.FloatField() 11 12 13 # ./manage.py shell 14 >>> from models import Fl 15 >>> a = Fl.objects.create(float=' 1.0 ') 16 >>> a 17 <Fl: Fl object> 18 >>> a.float 19 ' 1.0 ' 20 }}} 5 21 6 22 I'd have expected the FloatField to convert values to a float in the return object as well (I can verify that the `to_python` method is being run, because the number is saved to the database correctly.