mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #20487 -- Added test for querying mixed case fields with common related model.
Thanks Shai Berger for the review.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user