﻿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
3002	"admin getting confused by ""order_by"" statements."	terry@…	nobody	"Here are two simple models.  When I try to bring up the admin UI for the ""Faq"" model, it crashes.  The crash seems to show that it is somehow incorrectly getting the ""order_by"" entry from the FaqCategory class.

{{{
#!python
class FaqCategory(models.Model):
    name = models.CharField(maxlength=255)
    sortkey = models.IntegerField(default=0)
    def __str__(self):
        return ""[Sortkey %d] %s"" % (self.sortkey, self.name)

    class Admin:
        pass

    class Meta:
        ordering = ['sortkey', 'name']


class Faq(models.Model):
    category = models.ForeignKey(FaqCategory)
    sortkey = models.IntegerField(default=0)
    question = models.TextField()
    answer = models.TextField()
    def __str__(self):
        return ""[Sortkey %d] %s"" % (self.sortkey, self.question)

    class Admin:
        pass

    class Meta:
        ordering = ['category', 'sortkey', 'question']
        unique_together = (('category', 'sortkey', 'question'),)
}}}

This bug seems very similar to the one described in ticket 1547, but that one claims to be fixed."	defect	closed	contrib.admin		normal	fixed	nfa-changelist		Accepted	1	0	1	0	0	0
