models.py 375 B

123456789101112131415
  1. from __future__ import unicode_literals, print_function
  2. from django.db import models
  3. class SimpleModel(models.Model):
  4. number = models.IntegerField()
  5. contents = models.CharField(max_length=16)
  6. class UniqueTogetherModel(models.Model):
  7. foo = models.IntegerField()
  8. bar = models.IntegerField()
  9. class Meta(object):
  10. unique_together = ('foo', 'bar')