models.py 540 B

12345678910111213141516171819202122232425262728
  1. """
  2. Tests for forcing insert and update queries (instead of Django's normal
  3. automatic behavior).
  4. """
  5. from django.db import models
  6. class Counter(models.Model):
  7. name = models.CharField(max_length=10)
  8. value = models.IntegerField()
  9. class InheritedCounter(Counter):
  10. tag = models.CharField(max_length=10)
  11. class ProxyCounter(Counter):
  12. class Meta:
  13. proxy = True
  14. class SubCounter(Counter):
  15. pass
  16. class WithCustomPK(models.Model):
  17. name = models.IntegerField(primary_key=True)
  18. value = models.IntegerField()