diff options
author | Ramiro Morales <cramm0@gmail.com> | 2013-12-27 15:40:52 -0800 |
---|---|---|
committer | Ramiro Morales <cramm0@gmail.com> | 2013-12-27 15:40:52 -0800 |
commit | 61cfcec5b7d47232a1d6facbde71d4cca35986eb (patch) | |
tree | e4c87481b0e874b37c94335dfcd16bc3a53e1d20 /tests/schema/models.py | |
parent | 14bcbd9937f50ec21196dbb2bc3126e6a4427b37 (diff) | |
parent | 3efd1b8b939c0a600b2d63317d224ebaab766f01 (diff) | |
download | django-61cfcec5b7d47232a1d6facbde71d4cca35986eb.tar.gz |
Merge pull request #2120 from ramiro/schema-creation-quoting
Fixed #21692 -- Quote table name when creating it.
Diffstat (limited to 'tests/schema/models.py')
-rw-r--r-- | tests/schema/models.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/schema/models.py b/tests/schema/models.py index 44fecf7ebd..c4c8225970 100644 --- a/tests/schema/models.py +++ b/tests/schema/models.py @@ -1,5 +1,6 @@ from django.apps.registry import Apps from django.db import models +from django.utils.encoding import python_2_unicode_compatible # Because we want to test creation and deletion of these as separate things, # these models are all inserted into a separate Apps so the main test @@ -102,3 +103,15 @@ class BookWithLongName(models.Model): class Meta: apps = new_apps + + +# Based on tests/reserved_names/models.py +@python_2_unicode_compatible +class Thing(models.Model): + when = models.CharField(max_length=1, primary_key=True) + + class Meta: + db_table = 'select' + + def __str__(self): + return self.when |