Opened 16 years ago
Closed 10 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)
Change History (9)
comment:1 by , 16 years ago
Cc: | added |
---|---|
Patch needs improvement: | set |
by , 16 years ago
Attachment: | aggregations_postgresql_allow_charfields.diff added |
---|
comment:2 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
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 , 14 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:4 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:7 by , 12 years ago
Component: | ORM aggregation → Database layer (models, ORM) |
---|
comment:8 by , 10 years ago
Resolution: | → needsinfo |
---|---|
Status: | assigned → closed |
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.
wraps try/except around float(value) on convert_value