summaryrefslogtreecommitdiff
path: root/tests/model_fields/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/model_fields/models.py')
-rw-r--r--tests/model_fields/models.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py
index 13d4843632..02fea36b31 100644
--- a/tests/model_fields/models.py
+++ b/tests/model_fields/models.py
@@ -50,6 +50,14 @@ class Whiz(models.Model):
c = models.IntegerField(choices=CHOICES, null=True)
+class WhizDelayed(models.Model):
+ c = models.IntegerField(choices=(), null=True)
+
+
+# Contrived way of adding choices later.
+WhizDelayed._meta.get_field('c').choices = Whiz.CHOICES
+
+
class WhizIter(models.Model):
c = models.IntegerField(choices=iter(Whiz.CHOICES), null=True)
@@ -58,6 +66,14 @@ class WhizIterEmpty(models.Model):
c = models.CharField(choices=iter(()), blank=True, max_length=1)
+class Choiceful(models.Model):
+ no_choices = models.IntegerField(null=True)
+ empty_choices = models.IntegerField(choices=(), null=True)
+ with_choices = models.IntegerField(choices=[(1, 'A')], null=True)
+ empty_choices_bool = models.BooleanField(choices=())
+ empty_choices_text = models.TextField(choices=())
+
+
class BigD(models.Model):
d = models.DecimalField(max_digits=32, decimal_places=30)