summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_views/models.py
diff options
context:
space:
mode:
authorJulien Phalip <jphalip@gmail.com>2011-11-22 09:14:09 +0000
committerJulien Phalip <jphalip@gmail.com>2011-11-22 09:14:09 +0000
commit8ddecc39dbbb4da17a4eccff29bcf95efed991b8 (patch)
treed48193e251fb70012543d550a7fa10a9d711a78a /tests/regressiontests/admin_views/models.py
parent658abb0859382a07f88b2fe8e77d6c0035fcd456 (diff)
Fixed #17252 -- Fixed a minor regression introduced by the work in #11868, where the default sorted columns wouldn't correctly be visually represented in the changelist table headers if those columns referred to non model fields. Thanks to sebastian for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17143 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_views/models.py')
-rw-r--r--tests/regressiontests/admin_views/models.py36
1 files changed, 27 insertions, 9 deletions
diff --git a/tests/regressiontests/admin_views/models.py b/tests/regressiontests/admin_views/models.py
index d1a5d19dd0..eb56f9b6e3 100644
--- a/tests/regressiontests/admin_views/models.py
+++ b/tests/regressiontests/admin_views/models.py
@@ -538,13 +538,31 @@ class ComplexSortedPerson(models.Model):
age = models.PositiveIntegerField()
is_employee = models.NullBooleanField()
-class PrePopulatedPostLargeSlug(models.Model):
- """
- Regression test for #15938: a large max_length for the slugfield must not
- be localized in prepopulated_fields_js.html or it might end up breaking
- the javascript (ie, using THOUSAND_SEPARATOR ends up with maxLength=1,000)
- """
- title = models.CharField(max_length=100)
- published = models.BooleanField()
+class PrePopulatedPostLargeSlug(models.Model):
+ """
+ Regression test for #15938: a large max_length for the slugfield must not
+ be localized in prepopulated_fields_js.html or it might end up breaking
+ the javascript (ie, using THOUSAND_SEPARATOR ends up with maxLength=1,000)
+ """
+ title = models.CharField(max_length=100)
+ published = models.BooleanField()
slug = models.SlugField(max_length=1000)
-
+
+class AdminOrderedField(models.Model):
+ order = models.IntegerField()
+ stuff = models.CharField(max_length=200)
+
+class AdminOrderedModelMethod(models.Model):
+ order = models.IntegerField()
+ stuff = models.CharField(max_length=200)
+ def some_order(self):
+ return self.order
+ some_order.admin_order_field = 'order'
+
+class AdminOrderedAdminMethod(models.Model):
+ order = models.IntegerField()
+ stuff = models.CharField(max_length=200)
+
+class AdminOrderedCallable(models.Model):
+ order = models.IntegerField()
+ stuff = models.CharField(max_length=200)