Refs #20487 -- Added test for querying mixed case fields with common related model.

Thanks Shai Berger for the review.
This commit is contained in:
Mariusz Felisiak 2018-01-20 20:48:01 +01:00 committed by GitHub
parent 37c17846ad
commit aad1833fa0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 11 deletions

View file

@ -449,6 +449,14 @@ class CategoryItem(models.Model):
return "category item: " + str(self.category)
class MixedCaseFieldCategoryItem(models.Model):
CaTeGoRy = models.ForeignKey(SimpleCategory, models.CASCADE)
class MixedCaseDbColumnCategoryItem(models.Model):
category = models.ForeignKey(SimpleCategory, models.CASCADE, db_column='CaTeGoRy_Id')
class OneToOneCategory(models.Model):
new_name = models.CharField(max_length=15)
category = models.OneToOneField(SimpleCategory, models.CASCADE)
@ -462,6 +470,12 @@ class CategoryRelationship(models.Model):
second = models.ForeignKey(SimpleCategory, models.CASCADE, related_name='second_rel')
class CommonMixedCaseForeignKeys(models.Model):
category = models.ForeignKey(CategoryItem, models.CASCADE)
mixed_case_field_category = models.ForeignKey(MixedCaseFieldCategoryItem, models.CASCADE)
mixed_case_db_column_category = models.ForeignKey(MixedCaseDbColumnCategoryItem, models.CASCADE)
class NullableName(models.Model):
name = models.CharField(max_length=20, null=True)