> Can Django have a RealField that automatically does the cast?
I dont think it is a good idea to go that route in django and add that
as a standard django field, mainly for these reasons:
- FloatField happens to align correctly between pythons only "native"
float type and the chosen db
Hi!
I would like to provide an example of why this field is needed.
In PostgreSQL, a floating point literal like 4.6 has type decimal, not
binary floating point (see SELECT pg_typeof(4.6)).
When comparing binary floating point values to decimals, the decimal is
converted to double precision
I can see the appeal of allowing you to have fewer classes, but I don't
think that's a good thing in itself. Keeping responsibilities separate
("convert slugs to/from URL's" versus "be a slug") is a generally desirable
property.
This change would also complicate the URL parsing process: it would