diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2013-03-13 10:30:48 -0700 |
|---|---|---|
| committer | Florian Apolloner <florian@apolloner.eu> | 2013-03-13 22:39:25 +0100 |
| commit | 1059da8de675442e84381d6366c0be254681753e (patch) | |
| tree | 3f71e6c495d78425a46ef984125e30b7b69b6011 /tests/shared_models | |
| parent | 5d8342f321c1e1017e63555270999c9378f10185 (diff) | |
| parent | 4fa7f3cdd9bcf50ec4c7f64a31c1dfc02c375f46 (diff) | |
Merge pull request #900 from bmispelon/ticket-20022
Fix #20022: Correctly handle prefixes with url-unsafe characters in reverse()
Diffstat (limited to 'tests/shared_models')
| -rw-r--r-- | tests/shared_models/__init__.py | 0 | ||||
| -rw-r--r-- | tests/shared_models/models.py | 30 |
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/shared_models/__init__.py b/tests/shared_models/__init__.py new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/shared_models/__init__.py diff --git a/tests/shared_models/models.py b/tests/shared_models/models.py new file mode 100644 index 0000000000..61b3669bc4 --- /dev/null +++ b/tests/shared_models/models.py @@ -0,0 +1,30 @@ +from django.db import models +from django.utils import timezone +from django.utils.encoding import python_2_unicode_compatible + + +class Tag(models.Model): + name = models.CharField(max_length=255) + + +@python_2_unicode_compatible +class Author(models.Model): + name = models.CharField(max_length=100) + + def __str__(self): + return self.name + + +@python_2_unicode_compatible +class Book(models.Model): + name = models.CharField(max_length=200) + pages = models.IntegerField(default=0) + author = models.ForeignKey(Author, null=True) + pubdate = models.DateTimeField() + tags = models.ManyToManyField(Tag) + + class Meta: + ordering = ['-pubdate', 'name'] + + def __str__(self): + return self.name |
