summaryrefslogtreecommitdiff
path: root/parts/django/tests/modeltests/field_subclassing/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'parts/django/tests/modeltests/field_subclassing/models.py')
-rw-r--r--parts/django/tests/modeltests/field_subclassing/models.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/parts/django/tests/modeltests/field_subclassing/models.py b/parts/django/tests/modeltests/field_subclassing/models.py
new file mode 100644
index 0000000..b0d8336
--- /dev/null
+++ b/parts/django/tests/modeltests/field_subclassing/models.py
@@ -0,0 +1,22 @@
+"""
+Tests for field subclassing.
+"""
+
+from django.db import models
+from django.utils.encoding import force_unicode
+
+from fields import Small, SmallField, SmallerField, JSONField
+
+
+class MyModel(models.Model):
+ name = models.CharField(max_length=10)
+ data = SmallField('small field')
+
+ def __unicode__(self):
+ return force_unicode(self.name)
+
+class OtherModel(models.Model):
+ data = SmallerField()
+
+class DataModel(models.Model):
+ data = JSONField()