MCPcopy
hub / github.com/django/django / check_alias

Method check_alias

django/db/models/sql/query.py:1221–1237  ·  view source on GitHub ↗
(self, alias)

Source from the content-addressed store, hash-verified

1219 return alias or seen[None]
1220
1221 def check_alias(self, alias):
1222 # RemovedInDjango70Warning: When the deprecation ends, remove.
1223 if "%" in alias:
1224 warnings.warn(
1225 "Using percent signs in a column alias is deprecated.",
1226 category=RemovedInDjango70Warning,
1227 skip_file_prefixes=django_file_prefixes(),
1228 )
1229 if FORBIDDEN_ALIAS_PATTERN.search(alias):
1230 raise ValueError(
1231 "Column aliases cannot contain whitespace characters, hashes, "
1232 # RemovedInDjango70Warning: When the deprecation ends, replace
1233 # with:
1234 # "control characters, quotation marks, semicolons, percent "
1235 # "signs, or SQL comments."
1236 "control characters, quotation marks, semicolons, or SQL comments."
1237 )
1238
1239 def add_annotation(self, annotation, alias, select=True):
1240 """Add a single annotation expression to the Query."""

Callers 5

get_aggregationMethod · 0.95
add_annotationMethod · 0.95
add_filtered_relationMethod · 0.95
add_extraMethod · 0.95
set_valuesMethod · 0.95

Calls 2

django_file_prefixesFunction · 0.90
searchMethod · 0.80

Tested by

no test coverage detected