mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +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:
parent
37c17846ad
commit
aad1833fa0
2 changed files with 52 additions and 11 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue