models.py 309 B

1234567891011
  1. from django.db import models
  2. from django.utils.encoding import python_2_unicode_compatible
  3. @python_2_unicode_compatible
  4. class TestModel(models.Model):
  5. field1 = models.CharField(max_length=255)
  6. field2 = models.IntegerField()
  7. def __str__(self):
  8. return '%s%d' % (self.field1, self.field2)