aboutsummaryrefslogtreecommitdiff
path: root/tagging/tests/models.py
diff options
context:
space:
mode:
authorJonas Genannt <genannt@debian.org>2015-11-15 22:26:10 +0100
committerJonas Genannt <genannt@debian.org>2015-11-15 22:26:10 +0100
commitda6a2bd205506257eaa6785c00981c88146d6c9f (patch)
tree6636c5e5a0186d9bf42c0df12bbb2180480ace7b /tagging/tests/models.py
parent24cd0a91184be6fa20168f9b132b1ab3f5911949 (diff)
parentd65aa3c3c146b12548a54c894060bce9a8715ad2 (diff)
downloadpython-django-tagging-da6a2bd205506257eaa6785c00981c88146d6c9f.tar
python-django-tagging-da6a2bd205506257eaa6785c00981c88146d6c9f.tar.gz
Merge tag 'upstream/0.4'
Upstream version 0.4 # gpg: Signature made Sun 15 Nov 2015 10:26:06 PM CET using RSA key ID 016CFFD0 # gpg: Good signature from "Jonas Genannt <jonas@brachium-system.net>" # gpg: aka "Jonas Genannt <jonas.genannt@capi2name.de>" # gpg: aka "Jonas Genannt <genannt@debian.org>" * tag 'upstream/0.4': Imported Upstream version 0.4
Diffstat (limited to 'tagging/tests/models.py')
-rw-r--r--tagging/tests/models.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/tagging/tests/models.py b/tagging/tests/models.py
index 0708686..1babd58 100644
--- a/tagging/tests/models.py
+++ b/tagging/tests/models.py
@@ -1,38 +1,51 @@
from django.db import models
+from django.utils.encoding import python_2_unicode_compatible
from tagging.fields import TagField
+
class Perch(models.Model):
size = models.IntegerField()
smelly = models.BooleanField(default=True)
+
+@python_2_unicode_compatible
class Parrot(models.Model):
state = models.CharField(max_length=50)
perch = models.ForeignKey(Perch, null=True)
- def __unicode__(self):
+ def __str__(self):
return self.state
class Meta:
ordering = ['state']
+
+@python_2_unicode_compatible
class Link(models.Model):
name = models.CharField(max_length=50)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
ordering = ['name']
+
+@python_2_unicode_compatible
class Article(models.Model):
name = models.CharField(max_length=50)
- def __unicode__(self):
+ def __str__(self):
return self.name
class Meta:
ordering = ['name']
+
class FormTest(models.Model):
tags = TagField('Test', help_text='Test')
+
+
+class FormTestNull(models.Model):
+ tags = TagField(null=True)