mirror of
https://github.com/django/django.git
synced 2025-09-26 20:19:16 +00:00
Fixed #29949 -- Refactored db introspection identifier converters.
Removed DatabaseIntrospection.table_name_converter()/column_name_converter() and use instead DatabaseIntrospection.identifier_converter(). Removed DatabaseFeatures.uppercases_column_names. Thanks Tim Graham for the initial patch and review and Simon Charette for the review.
This commit is contained in:
parent
2e4776196d
commit
d5f4ce9849
15 changed files with 64 additions and 76 deletions
|
@ -1347,7 +1347,7 @@ class RawQuerySet:
|
|||
|
||||
def resolve_model_init_order(self):
|
||||
"""Resolve the init field names and value positions."""
|
||||
converter = connections[self.db].introspection.column_name_converter
|
||||
converter = connections[self.db].introspection.identifier_converter
|
||||
model_init_fields = [f for f in self.model._meta.fields if converter(f.column) in self.columns]
|
||||
annotation_fields = [(column, pos) for pos, column in enumerate(self.columns)
|
||||
if column not in self.model_fields]
|
||||
|
@ -1469,7 +1469,7 @@ class RawQuerySet:
|
|||
@cached_property
|
||||
def model_fields(self):
|
||||
"""A dict mapping column names to model field names."""
|
||||
converter = connections[self.db].introspection.table_name_converter
|
||||
converter = connections[self.db].introspection.identifier_converter
|
||||
model_fields = {}
|
||||
for field in self.model._meta.fields:
|
||||
name, column = field.get_attname_column()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue