1
0
mirror of https://github.com/django/django.git synced 2025-01-08 17:37:20 +00:00

chore: typos fixed

loookup -> lookup
indentity -> identity
travelled -> traveled
depraction -> deprecation
orignal -> original
exceptionsm -> exceptions
This commit is contained in:
Emad Rad 2024-07-21 01:11:39 +03:30
parent 43287cbb87
commit c4fc4ec6d0
6 changed files with 10 additions and 10 deletions

View File

@ -62,7 +62,7 @@ class DatabaseOperations(BaseDatabaseOperations):
# EXTRACT returns 1-53 based on ISO-8601 for the week number.
lookup_type = lookup_type.upper()
if not self._extract_format_re.fullmatch(lookup_type):
raise ValueError(f"Invalid loookup type: {lookup_type!r}")
raise ValueError(f"Invalid lookup type: {lookup_type!r}")
return f"EXTRACT({lookup_type} FROM {sql})", params
def date_trunc_sql(self, lookup_type, sql, params, tzname=None):

View File

@ -99,7 +99,7 @@ END;
else:
lookup_type = lookup_type.upper()
if not self._extract_format_re.fullmatch(lookup_type):
raise ValueError(f"Invalid loookup type: {lookup_type!r}")
raise ValueError(f"Invalid lookup type: {lookup_type!r}")
# https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/EXTRACT-datetime.html
return f"EXTRACT({lookup_type} FROM {sql})", params
return extract_sql, (*params, extract_param)

View File

@ -51,7 +51,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
"ALTER TABLE %(table)s ALTER COLUMN %(column)s ADD "
"GENERATED BY DEFAULT AS IDENTITY"
)
sql_drop_indentity = (
sql_drop_identity = (
"ALTER TABLE %(table)s ALTER COLUMN %(column)s DROP IDENTITY IF EXISTS"
)
@ -201,7 +201,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
# Drop IDENTITY if exists (pre-Django 4.1 serial columns don't have
# it).
self.execute(
self.sql_drop_indentity
self.sql_drop_identity
% {
"table": self.quote_name(table),
"column": self.quote_name(strip_quotes(new_field.column)),

View File

@ -19,7 +19,7 @@ class MultiJoin(Exception):
def __init__(self, names_pos, path_with_names):
self.level = names_pos
# The path travelled, this includes the path to the multijoin.
# The path traveled, this includes the path to the multijoin.
self.names_with_path = path_with_names
@ -96,12 +96,12 @@ class Join:
qn = compiler.quote_name_unless_alias
qn2 = connection.ops.quote_name
# Add a join condition for each pair of joining columns.
# RemovedInDjango60Warning: when the depraction ends, replace with:
# RemovedInDjango60Warning: when the deprecation ends, replace with:
# for lhs, rhs in self.join_field:
join_fields = self.join_fields or self.join_cols
for lhs, rhs in join_fields:
if isinstance(lhs, str):
# RemovedInDjango60Warning: when the depraction ends, remove
# RemovedInDjango60Warning: when the deprecation ends, remove
# the branch for strings.
lhs_full_name = "%s.%s" % (qn(self.parent_alias), qn2(lhs))
rhs_full_name = "%s.%s" % (qn(self.table_alias), qn2(rhs))

View File

@ -34,10 +34,10 @@ class GZipMiddleware(MiddlewareMixin):
if response.is_async:
# pull to lexical scope to capture fixed reference in case
# streaming_content is set again later.
orignal_iterator = response.streaming_content
original_iterator = response.streaming_content
async def gzip_wrapper():
async for chunk in orignal_iterator:
async for chunk in original_iterator:
yield compress_string(
chunk,
max_random_bytes=self.max_random_bytes,

View File

@ -53,7 +53,7 @@ def do_timezone(value, arg):
if timezone.is_naive(value):
default_timezone = timezone.get_default_timezone()
value = timezone.make_aware(value, default_timezone)
# Filters must never raise exceptionsm, so catch everything.
# Filters must never raise exceptions, so catch everything.
except Exception:
return ""