2008-08-09 19:19:23 +02:00
|
|
|
"""
|
|
|
|
Tests for forcing insert and update queries (instead of Django's normal
|
2011-12-17 18:37:24 +01:00
|
|
|
automatic behavior).
|
2008-08-09 19:19:23 +02:00
|
|
|
"""
|
2011-07-13 11:35:51 +02:00
|
|
|
from django.db import models
|
2008-08-09 19:19:23 +02:00
|
|
|
|
2011-10-13 20:04:12 +02:00
|
|
|
|
2008-08-09 19:19:23 +02:00
|
|
|
class Counter(models.Model):
|
2013-11-03 19:17:58 +01:00
|
|
|
name = models.CharField(max_length=10)
|
2008-08-09 19:19:23 +02:00
|
|
|
value = models.IntegerField()
|
|
|
|
|
2013-11-03 05:36:09 +01:00
|
|
|
|
2011-11-12 20:06:39 +01:00
|
|
|
class InheritedCounter(Counter):
|
|
|
|
tag = models.CharField(max_length=10)
|
|
|
|
|
2013-11-03 05:36:09 +01:00
|
|
|
|
2011-11-12 20:06:39 +01:00
|
|
|
class ProxyCounter(Counter):
|
|
|
|
class Meta:
|
|
|
|
proxy = True
|
|
|
|
|
2013-11-03 05:36:09 +01:00
|
|
|
|
2011-11-12 20:06:39 +01:00
|
|
|
class SubCounter(Counter):
|
|
|
|
pass
|
|
|
|
|
2013-11-03 05:36:09 +01:00
|
|
|
|
2008-08-09 19:19:23 +02:00
|
|
|
class WithCustomPK(models.Model):
|
|
|
|
name = models.IntegerField(primary_key=True)
|
|
|
|
value = models.IntegerField()
|