﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
7256	extra() does not play well with values()	Nicolas Lara	Nicolas Lara	"When using extra() on a !ValuesQuerySet or aplying values to a queryset with extra_select, the selection done by extra() is not preserved
{{{
>>> Book.objects.all().values().extra(select={'price_per_page' : 'price / pages'}).get(pk=1)
{'id': 1,
 'isbn': u'159059725',
 'name': u' The Definitive Guide to Django: Web Development Done Right',
 'pages': 447,
 'price': 30.0,
 'publisher_id': 1}

>>> Book.objects.all().extra(select={'price_per_page' : 'price / pages'}).values().get(pk=1)
{'id': 1,
 'isbn': u'159059725',
 'name': u' The Definitive Guide to Django: Web Development Done Right',
 'pages': 447,
 'price': 30.0,
 'publisher_id': 1}

}}}

while:

{{{
>>> Book.objects.all().extra(select={'price_per_page' : 'price / pages'}).get(pk=1).__dict__
{'id': 1,
 'isbn': u'159059725',
 'name': u' The Definitive Guide to Django: Web Development Done Right',
 'pages': 447,
 'price': 30.0,
 'price_per_page': 0.067114093959731502,
 'publisher_id': 1}
}}}

I am assigning the ticket to myself, but wont work on it until after aggregation is stable (also im waiting for it to be 'Accepted')."		closed	Database layer (models, ORM)	dev		fixed	qsrf-cleanup extra values	jdunck@…	Accepted	1	0	0	0	0	0
