CombinedLexeme
This class represents a combination of two search lexemes or expressions using a specific connector, such as a logical operator. It provides functionality to compile the combined expression into SQL and supports logical inversion through the application of De Morgan's theorem.
Methods
as_sql()
@classmethod
def as_sql(
compiler: [SQLCompiler](../../../db/models/sql/compiler/sqlcompiler.md?sid=django_db_models_sql_compiler_sqlcompiler),
connection: DatabaseConnection
) - > tuple
Generates the SQL representation for the combined lexeme by compiling the left and right hand expressions and joining them with the appropriate connector.
Parameters
| Name | Type | Description |
|---|---|---|
| compiler | [SQLCompiler](../../../db/models/sql/compiler/sqlcompiler.md?sid=django_db_models_sql_compiler_sqlcompiler) | The compiler instance used to generate the SQL string for the expressions. |
| connection | DatabaseConnection | The current database connection used to handle backend-specific SQL generation. |
Returns
| Type | Description |
|---|---|
tuple | A tuple containing the SQL placeholder string and a list containing the formatted combined SQL value. |