Lookups API¶
- django_spanner.lookups.cast_param_to_float(self, compiler, connection)[source]¶
A method to extend Django Exact, GreaterThan, GreaterThanOrEqual, LessThan, and LessThanOrEqual classes.
- Parameters
self (
Exact
orGreaterThan
orGreaterThanOrEqual
orLessThan
orLessThanOrEqual
) – the instance of the class that owns this method.compiler (
SQLCompilerst
) – The query compiler responsible for generating the query. Must have a compile method, returning a (sql, [params]) tuple. Calling compiler(value) will return a quotedvalue
.connection (
Connection
) – The Spanner database connection used for the current query.
- Return type
- Returns
A tuple of the SQL request and float parameters.
- django_spanner.lookups.contains(self, compiler, connection)[source]¶
A method to extend Django Contains and IContains classes.
- Parameters
self (
Contains
orIContains
) – the instance of the class that owns this method.compiler (
SQLCompilerst
) – The query compiler responsible for generating the query. Must have a compile method, returning a (sql, [params]) tuple. Calling compiler(value) will return a quotedvalue
.connection (
Connection
) – The Spanner database connection used for the current query.
- Return type
- Returns
A tuple of the SQL request and parameters.
- django_spanner.lookups.iexact(self, compiler, connection)[source]¶
A method to extend Django IExact class. Case-insensitive exact match. If the value provided for comparison is None, it will be interpreted as an SQL NULL.
- Parameters
self (
IExact
) – the instance of the class that owns this method.compiler (
SQLCompilerst
) – The query compiler responsible for generating the query. Must have a compile method, returning a (sql, [params]) tuple. Calling compiler(value) will return a quotedvalue
.connection (
Connection
) – The Spanner database connection used for the current query.
- Return type
- Returns
A tuple of the SQL request and parameters.
- django_spanner.lookups.regex(self, compiler, connection)[source]¶
A method to extend Django Regex and IRegex classes.
- Parameters
self (
Regex
orIRegex
) – the instance of the class that owns this method.compiler (
SQLCompilerst
) – The query compiler responsible for generating the query. Must have a compile method, returning a (sql, [params]) tuple. Calling compiler(value) will return a quotedvalue
.connection (
Connection
) – The Spanner database connection used for the current query.
- Return type
- Returns
A tuple of the SQL request and parameters.
- django_spanner.lookups.register_lookups()[source]¶
Registers the above methods with the corersponding Django classes.
- django_spanner.lookups.startswith_endswith(self, compiler, connection)[source]¶
A method to extend Django StartsWith, IStartsWith, EndsWith, and IEndsWith classes.
- Parameters
self (
StartsWith
orIStartsWith
orEndsWith
orIEndsWith
) – the instance of the class that owns this method.compiler (
SQLCompilerst
) – The query compiler responsible for generating the query. Must have a compile method, returning a (sql, [params]) tuple. Calling compiler(value) will return a quotedvalue
.connection (
Connection
) – The Spanner database connection used for the current query.
- Return type
- Returns
A tuple of the SQL request and parameters.