diff options
| author | Vlad Starostin <drtyrsa@yandex.ru> | 2014-05-16 14:25:45 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-05-16 10:40:07 -0400 |
| commit | 1be03aff5c24e902b89503dda32891aa4881579e (patch) | |
| tree | ca29e88203cf95e278ce7e77bbb2559571c0a4da /tests | |
| parent | ddd52b221c5b005e42db3177f25a6b81561dea63 (diff) | |
Fixed #18389 -- Fixed the way contribute_to_class is called
Now this method is only called only if the object is an instance.
This allows to have field classes as model class attributes.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/model_fields/models.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/model_fields/models.py b/tests/model_fields/models.py index 8a6e9c83b1..0222f9a3df 100644 --- a/tests/model_fields/models.py +++ b/tests/model_fields/models.py @@ -145,12 +145,22 @@ class VerboseNameField(models.Model): field22 = models.URLField("verbose field22") -# This model isn't used in any test, just here to ensure it validates successfully. +############################################################################### +# These models aren't used in any test, just here to ensure they validate +# successfully. + # See ticket #16570. class DecimalLessThanOne(models.Model): d = models.DecimalField(max_digits=3, decimal_places=3) +# See ticket #18389. +class FieldClassAttributeModel(models.Model): + field_class = models.CharField + +############################################################################### + + class DataModel(models.Model): short_data = models.BinaryField(max_length=10, default=b'\x08') data = models.BinaryField() |
