PageRenderTime 33ms CodeModel.GetById 22ms RepoModel.GetById 1ms 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
Possible License(s): BSD-3-Clause
  1. """
  2. Tests for field subclassing.
  3. """
  4. from django.db import models
  5. from django.utils.encoding import force_unicode
  6. from fields import Small, SmallField, SmallerField, JSONField
  7. class MyModel(models.Model):
  8. name = models.CharField(max_length=10)
  9. data = SmallField('small field')
  10. def __unicode__(self):
  11. return force_unicode(self.name)
  12. class OtherModel(models.Model):
  13. data = SmallerField()
  14. class DataModel(models.Model):
  15. data = JSONField()