Re: Ticket #32118 Add field for 4-bytes floats (RealField/SmallFloatField)

2022-08-25 Thread Jörg Breitbart
> 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

Ticket #32118 Add field for 4-bytes floats (RealField/SmallFloatField)

2022-08-25 Thread 'Zeev Tarantov' via Django developers (Contributions to Django itself)
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

Re: Change `to_python` and `to_url` to be class methods on path converters

2022-08-25 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
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