Opened 9 years ago

Closed 4 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


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 9 years ago.
wraps try/except around float(value) on convert_value

Download all attachments as: .zip

Change History (9)

comment:1 Changed 9 years ago by Guillermo Gutiérrez

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

Changed 9 years ago by Guillermo Gutiérrez

wraps try/except around float(value) on convert_value

comment:2 Changed 9 years ago by Russell Keith-Magee

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 Changed 8 years ago by Greg Wogan-Browne

Owner: set to Greg Wogan-Browne
Status: newassigned

comment:4 Changed 7 years ago by Luke Plant

Severity: Normal
Type: New feature

comment:5 Changed 7 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:6 Changed 7 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:7 Changed 6 years ago by Anssi Kääriäinen

Component: ORM aggregationDatabase layer (models, ORM)

comment:8 Changed 4 years ago by Tim Graham

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