PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 38ms app.codeStats 0ms

/tests/modeltests/field_subclassing/models.py

https://code.google.com/p/mango-py/
Python | 22 lines | 12 code | 7 blank | 3 comment | 0 complexity | eaf6925bccd88a76f7768d6034fbd3e2 MD5 | raw file
 1"""
 2Tests for field subclassing.
 3"""
 4
 5from django.db import models
 6from django.utils.encoding import force_unicode
 7
 8from fields import Small, SmallField, SmallerField, JSONField
 9
10
11class MyModel(models.Model):
12    name = models.CharField(max_length=10)
13    data = SmallField('small field')
14
15    def __unicode__(self):
16        return force_unicode(self.name)
17
18class OtherModel(models.Model):
19    data = SmallerField()
20
21class DataModel(models.Model):
22    data = JSONField()