(self, alias)
| 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.""" |
no test coverage detected