mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
Проверка 09.02.2025
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# sql/util.py
|
||||
# Copyright (C) 2005-2024 the SQLAlchemy authors and contributors
|
||||
# Copyright (C) 2005-2025 the SQLAlchemy authors and contributors
|
||||
# <see AUTHORS file>
|
||||
#
|
||||
# This module is part of SQLAlchemy and is released under
|
||||
@@ -106,7 +106,7 @@ def join_condition(
|
||||
|
||||
would produce an expression along the lines of::
|
||||
|
||||
tablea.c.id==tableb.c.tablea_id
|
||||
tablea.c.id == tableb.c.tablea_id
|
||||
|
||||
The join is determined based on the foreign key relationships
|
||||
between the two selectables. If there are multiple ways
|
||||
@@ -268,7 +268,7 @@ def visit_binary_product(
|
||||
|
||||
The function is of the form::
|
||||
|
||||
def my_fn(binary, left, right)
|
||||
def my_fn(binary, left, right): ...
|
||||
|
||||
For each binary expression located which has a
|
||||
comparison operator, the product of "left" and
|
||||
@@ -277,12 +277,11 @@ def visit_binary_product(
|
||||
|
||||
Hence an expression like::
|
||||
|
||||
and_(
|
||||
(a + b) == q + func.sum(e + f),
|
||||
j == r
|
||||
)
|
||||
and_((a + b) == q + func.sum(e + f), j == r)
|
||||
|
||||
would have the traversal::
|
||||
would have the traversal:
|
||||
|
||||
.. sourcecode:: text
|
||||
|
||||
a <eq> q
|
||||
a <eq> e
|
||||
@@ -528,9 +527,7 @@ def bind_values(clause):
|
||||
|
||||
E.g.::
|
||||
|
||||
>>> expr = and_(
|
||||
... table.c.foo==5, table.c.foo==7
|
||||
... )
|
||||
>>> expr = and_(table.c.foo == 5, table.c.foo == 7)
|
||||
>>> bind_values(expr)
|
||||
[5, 7]
|
||||
"""
|
||||
@@ -1041,20 +1038,24 @@ class ClauseAdapter(visitors.ReplacingExternalTraversal):
|
||||
|
||||
E.g.::
|
||||
|
||||
table1 = Table('sometable', metadata,
|
||||
Column('col1', Integer),
|
||||
Column('col2', Integer)
|
||||
)
|
||||
table2 = Table('someothertable', metadata,
|
||||
Column('col1', Integer),
|
||||
Column('col2', Integer)
|
||||
)
|
||||
table1 = Table(
|
||||
"sometable",
|
||||
metadata,
|
||||
Column("col1", Integer),
|
||||
Column("col2", Integer),
|
||||
)
|
||||
table2 = Table(
|
||||
"someothertable",
|
||||
metadata,
|
||||
Column("col1", Integer),
|
||||
Column("col2", Integer),
|
||||
)
|
||||
|
||||
condition = table1.c.col1 == table2.c.col1
|
||||
|
||||
make an alias of table1::
|
||||
|
||||
s = table1.alias('foo')
|
||||
s = table1.alias("foo")
|
||||
|
||||
calling ``ClauseAdapter(s).traverse(condition)`` converts
|
||||
condition to read::
|
||||
|
Reference in New Issue
Block a user