﻿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
21918	Ordering changing order_by behavior	hugotacito@…	nobody	"Not sure if its a bug, but i am having this problem:

models.py
{{{
class Year(models.Model):
   year = models.IntegerField(unique=True) 
   class Meta:
        ordering = ['-year']
}}}


views.py
{{{
def list_years(request):
   year = Year.objects.all().order_by('-year')
   ...
}}}


The problem is that the order_by is returning ascending probably because of the ordering from the meta class. In my opinion the order_by should not be affected by the ordering attribute from the meta class for clarity."	Uncategorized	closed	Database layer (models, ORM)	1.5	Normal	invalid	ordering		Unreviewed	0	0	0	0	0	0
