﻿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
28317	QuerySet.extra cannot reference a column name with a capital letter	ekarat	nobody	"Minimal steps to recreate:

1) Create a model with a field that has a capital letter.  eg:


{{{
class A(models.Model):
    baseValue = models.IntegerField(default=0)
    class Meta:
        app_label = 'myapp'
}}}

2) Refer to that column with QuerySet.extra, either as a select or as a where.  eg:

{{{
A.objects.all().extra(select={'test' : 'baseValue'})
}}}

3) The result is that Django turns baseValue to basevalue and looks for a column with that name.  However, the column name is baseValue:

{{{
Exception Value: column ""basevalue"" does not exist
LINE 1: SELECT (baseValue) AS ""test"", ""myapp_a"".""id"", ""myapp_a...
                ^
HINT:  Perhaps you meant to reference the column ""myapp_a.baseValue"".
}}}

Sadly, I need the extra feature for a 3-way join: t1.x=t2.x AND t1.y=t3.y AND t2.z=t3.z
I will create another ticket for that and reference this one."	Bug	closed	Database layer (models, ORM)	1.10	Normal	invalid	QuerySet.extra		Unreviewed	0	0	0	0	0	0
