Changes between Initial Version and Version 2 of Ticket #23320


Ignore:
Timestamp:
Aug 20, 2014, 2:33:07 AM (10 years ago)
Author:
Baptiste Mispelon
Comment:

(pulled in the code from dpaste so that this report still makes sense in 4 weeks after the link expires)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23320

    • Property Cc cmawebsite@… added
    • Property Type UncategorizedCleanup/optimization
  • Ticket #23320 – Description

    initial v2  
    22
    33Is the behaviour outlined in this snippet expected:
    4 https://dpaste.de/BAck
     4{{{#!python
     5# models.py
     6from django.db import models
     7 
     8class 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}}}
    521
    622I'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.
Back to Top