#16735: Queryset values should be aliasable
----------------------------+----------------------------------------------
 Reporter:                  |          Owner:  nobody
  alex.latchford@…          |         Status:  new
     Type:  New feature     |      Component:  Database layer (models, ORM)
Milestone:                  |       Severity:  Normal
  Version:  1.3             |   Triage Stage:  Unreviewed
 Keywords:  queryset,       |  Easy pickings:  0
  alias, values             |
Has patch:  0               |
    UI/UX:  0               |
----------------------------+----------------------------------------------
 {{{
 Student.objects.all().values('name', 'mother__name',
 'class__teacher__name')
 > QD {'name': 'Freddie', 'mother__name': 'Helen', 'class__teacher__name':
 'Mr Williams'}
 }}}


 This sort of query doesn't quite demonstrate the problem fully, but it's
 the best example I can think of for now. Essentially I'd like to be able
 to alias these values in such a fashion that they are easily
 distinguishable or able to be shortened..

 I envisage something like this..


 {{{
 Student.objects.all().values(student_name='name',
 mother_name='mother__name', teacher_name='class__teacher__name')
 > QD {'student_name': 'Freddie', 'mother_name': 'Helen', 'teacher_name':
 'Mr Williams'}
 }}}


 You should also be able to leave arguments if the standard name will
 suffice..

 Many thanks,
 Alex

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16735>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to