﻿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
29272	Queryset using order_by(F()) fails to compile with values_list	bszfw	nobody	"Here is a simplified version of what I am trying to do:

{{{
from django.db import models
from django.db.models import IntegerField, F, Value

class Question(models.Model):
    question_text = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')

    def __str__(self):
        return self.question_text

Question.objects.annotate(test=Value(1, output_field=IntegerField())).order_by(F('test')).values_list('question_text')
}}}

It works without using {{{F}}}, or by adding the annotated value to {{{values_list}}}.
But I need {{{F}}} to be able to write {{{F('test').asc(nulls_last=True)}}}, and I cannot modify {{{values_list}}} as it is added to the Queryset later in code which does not know anything about the annotation."	Bug	closed	Database layer (models, ORM)	2.0	Normal	duplicate			Unreviewed	0	0	0	0	0	0
