#12222 closed (duplicate)
rename items in values() — at Version 3
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.1 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I wish there were a way to do instead of this:
MyModel.objects.values('otherfield__anotherjoinedfield__blah__derp__foo__doop') {'otherfield__anotherjoinedfield__blah__derp__foo__doop': 4, 'otherfield__anotherjoinedfield__blah__derp__foo__doop': 5, [...]
you could do this:
{'val': 4, 'val': 5, [...]
Change History (3)
comment:1 by , 15 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
- Please use preview.
- I think you're looking for !__in.
comment:2 by , 15 years ago
Sorry I didn't realize it would change the formatting. I'd fix it if I could but I can't figure out how to edit it.
"__in" has nothing to do with what the ticket was about. You know how you can rename an annotation by doing .annotate(name=Sum('field'))? Well that functionality should exist for values() as well.
comment:3 by , 15 years ago
Description: | modified (diff) |
---|
Note:
See TracTickets
for help on using tickets.