Opened 15 years ago

Closed 9 years ago

#10932 closed New feature (needsinfo)

Allow Min() on CharFields on postgres

Reported by: Guillermo Gutiérrez Owned by: Greg Wogan-Browne
Component: Database layer (models, ORM) Version: 1.0
Severity: Normal Keywords:
Cc: guillermo.gutierrez@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Ticket #3566 (features aggregation for ORM) adds method convert_value which fall into "float(value)" and then, does not allow to apply Min, Max, etc, to CharFields. sqlite backend overwrites (in DatabaseOperations) this and returns value instead of float(value), but postgres backend does not overwrite this method.
I'll attach an improvable workaround on this.

Attachments (1)

aggregations_postgresql_allow_charfields.diff (700 bytes ) - added by Guillermo Gutiérrez 15 years ago.
wraps try/except around float(value) on convert_value

Download all attachments as: .zip

Change History (9)

comment:1 by Guillermo Gutiérrez, 15 years ago

Cc: guillermo.gutierrez@… added
Patch needs improvement: set

by Guillermo Gutiérrez, 15 years ago

wraps try/except around float(value) on convert_value

comment:2 by Russell Keith-Magee, 15 years ago

Triage Stage: UnreviewedAccepted

Looks good in principle. However, it needs tests - if only so that it is easy to demonstrate that this approach will work across all supported backends.

comment:3 by Greg Wogan-Browne, 13 years ago

Owner: set to Greg Wogan-Browne
Status: newassigned

comment:4 by Luke Plant, 13 years ago

Severity: Normal
Type: New feature

comment:5 by Aymeric Augustin, 12 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:6 by Aymeric Augustin, 12 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:7 by Anssi Kääriäinen, 11 years ago

Component: ORM aggregationDatabase layer (models, ORM)

comment:8 by Tim Graham, 9 years ago

Resolution: needsinfo
Status: assignedclosed

I can't tell what this ticket is requesting from its description or its patch. Possibly it is fixed with enhanced expressions support in 1.8. If not, please reopen with more details.

Note: See TracTickets for help on using tickets.
Back to Top