summaryrefslogtreecommitdiff
path: root/tests/contenttypes_tests/models.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-03-14 20:28:24 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-03-14 20:30:23 +0100
commit3f2befc93163e0666dcc4f745288b98306de4b8e (patch)
treeecca16348da0fab7c87bba937090aef498c9ff2f /tests/contenttypes_tests/models.py
parent2f121dfe635b3f497fe1fe03bc8eb97cdf5083b3 (diff)
Deprecated django.views.defaults.shortcut.
Diffstat (limited to 'tests/contenttypes_tests/models.py')
-rw-r--r--tests/contenttypes_tests/models.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/contenttypes_tests/models.py b/tests/contenttypes_tests/models.py
new file mode 100644
index 0000000000..3c6685687a
--- /dev/null
+++ b/tests/contenttypes_tests/models.py
@@ -0,0 +1,24 @@
+from __future__ import absolute_import, unicode_literals
+
+from django.db import models
+from django.utils.encoding import python_2_unicode_compatible
+
+@python_2_unicode_compatible
+class Author(models.Model):
+ name = models.CharField(max_length=100)
+
+ def __str__(self):
+ return self.name
+
+ def get_absolute_url(self):
+ return '/views/authors/%s/' % self.id
+
+@python_2_unicode_compatible
+class Article(models.Model):
+ title = models.CharField(max_length=100)
+ slug = models.SlugField()
+ author = models.ForeignKey(Author)
+ date_created = models.DateTimeField()
+
+ def __str__(self):
+ return self.title