class documentation

class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations):

View In Hierarchy

Undocumented

Method ​_get​_spatialite​_func Helper routine for calling SpatiaLite functions and returning their result. Any error occurring in this method should be handled by the caller.
Method convert​_extent Convert the polygon data received from SpatiaLite to min/max values.
Method geo​_db​_type Return None because geometry columns are added via the AddGeometryColumn stored procedure on SpatiaLite.
Method geom​_lib​_version Return the version of the version-dependant geom library used by SpatiaLite.
Method geometry​_columns Undocumented
Method geos​_version Return the version of GEOS used by SpatiaLite as a string.
Method get​_distance Return the distance parameters for the given geometry field, lookup value, and lookup type.
Method get​_geometry​_converter Undocumented
Method lwgeom​_version Return the version of LWGEOM library used by SpatiaLite.
Method proj​_version Return the version of the PROJ library used by SpatiaLite.
Method rttopo​_version Return the version of RTTOPO library used by SpatiaLite.
Method spatial​_aggregate​_name Return the spatial aggregate SQL template and function for the given Aggregate instance.
Method spatial​_ref​_sys Undocumented
Method spatialite​_version Return the SpatiaLite library version as a string.
Method spatialite​_version​_tuple Return the SpatiaLite version as a tuple (version string, major, minor, subminor).
Class Variable collect Undocumented
Class Variable disallowed​_aggregates Undocumented
Class Variable extent Undocumented
Class Variable from​_text Undocumented
Class Variable function​_names Undocumented
Class Variable gis​_operators Undocumented
Class Variable makeline Undocumented
Class Variable name Undocumented
Class Variable select Undocumented
Class Variable spatialite Undocumented
Class Variable unionagg Undocumented
Property spatial​_version Determine the version of the SpatiaLite library.
Property unsupported​_functions Undocumented

Inherited from BaseSpatialOperations:

Method check​_expression​_support Undocumented
Method convert​_extent3d Undocumented
Method geo​_quote​_name Undocumented
Method get​_area​_att​_for​_field Undocumented
Method get​_db​_converters Undocumented
Method get​_distance​_att​_for​_field Undocumented
Method get​_geom​_placeholder No summary
Method spatial​_function​_name Undocumented
Class Variable distance​_expr​_for​_lookup Undocumented
Class Variable geom​_func​_prefix Undocumented
Class Variable mariadb Undocumented
Class Variable mysql Undocumented
Class Variable oracle Undocumented
Class Variable postgis Undocumented
Property select​_extent Undocumented

Inherited from DatabaseOperations:

Method __references​_graph Undocumented
Method ​_convert​_tznames​_to​_sql Undocumented
Method ​_quote​_params​_for​_last​_executed​_query Only for last_executed_query! Don't use this to execute SQL queries!
Method adapt​_datetimefield​_value Transform a datetime value to an object compatible with what is expected by the backend driver for datetime columns.
Method adapt​_timefield​_value Transform a time value to an object compatible with what is expected by the backend driver for time columns.
Method bulk​_batch​_size SQLite has a compile-time default (SQLITE_LIMIT_VARIABLE_NUMBER) of 999 variables per query.
Method bulk​_insert​_sql Undocumented
Method check​_expression​_support Check that the backend supports the provided expression.
Method combine​_duration​_expression Undocumented
Method combine​_expression No summary
Method convert​_booleanfield​_value Undocumented
Method convert​_datefield​_value Undocumented
Method convert​_datetimefield​_value Undocumented
Method convert​_timefield​_value Undocumented
Method convert​_uuidfield​_value Undocumented
Method date​_extract​_sql Support EXTRACT with a user-defined function django_date_extract() that's registered in connect(). Use single quotes because this is a string and could otherwise cause a collision with a field name.
Method date​_trunc​_sql Given a lookup_type of 'year', 'month', or 'day', return the SQL that truncates the given date or datetime field field_name to a date object with only the given specificity.
Method datetime​_cast​_date​_sql Return the SQL to cast a datetime value to date value.
Method datetime​_cast​_time​_sql Return the SQL to cast a datetime value to time value.
Method datetime​_extract​_sql Given a lookup_type of 'year', 'month', 'day', 'hour', 'minute', or 'second', return the SQL that extracts a value from the given datetime field field_name.
Method datetime​_trunc​_sql Given a lookup_type of 'year', 'month', 'day', 'hour', 'minute', or 'second', return the SQL that truncates the given datetime field field_name to a datetime object with only the given specificity.
Method fetch​_returned​_insert​_rows Given a cursor object that has just performed an INSERT...RETURNING statement into a table, return the list of returned data.
Method format​_for​_duration​_arithmetic Do nothing since formatting is handled in the custom function.
Method get​_db​_converters Return a list of functions needed to convert field data.
Method get​_decimalfield​_converter Undocumented
Method insert​_statement Undocumented
Method integer​_field​_range Given an integer field internal type (e.g. 'PositiveIntegerField'), return a tuple of the (min_value, max_value) form representing the range of the column type bound to the field.
Method last​_executed​_query Return a string of the query last executed by the given cursor, with placeholders replaced with actual values.
Method no​_limit​_value Return the value to use for the LIMIT when we are wanting "LIMIT infinity". Return None if the limit clause can be omitted in this case.
Method pk​_default​_value Return the value to use during an INSERT statement to specify that the field should use its default value.
Method quote​_name Return a quoted version of the given table, index, or column name. Do not quote the given name if it's already been quoted.
Method return​_insert​_columns For backends that support returning columns as part of an insert query, return the SQL and params to append to the INSERT query. The returned fragment should contain a format string to hold the appropriate column.
Method sequence​_reset​_by​_name​_sql Return a list of the SQL statements required to reset sequences passed in sequences.
Method sql​_flush Return a list of SQL statements required to remove all data from the given database tables (without actually removing the tables themselves).
Method subtract​_temporals Undocumented
Method time​_extract​_sql Given a lookup_type of 'hour', 'minute', or 'second', return the SQL that extracts a value from the given time field field_name.
Method time​_trunc​_sql Given a lookup_type of 'hour', 'minute' or 'second', return the SQL that truncates the given time or datetime field field_name to a time object with only the given specificity.
Class Variable cast​_char​_field​_without​_max​_length Undocumented
Class Variable cast​_data​_types Undocumented
Class Variable explain​_prefix Undocumented
Class Variable jsonfield​_datatype​_values Undocumented
Property ​_references​_graph Undocumented

Inherited from BaseDatabaseOperations (via DatabaseOperations):

Constant CURRENT​_ROW Undocumented
Constant FOLLOWING Undocumented
Constant PRECEDING Undocumented
Constant UNBOUNDED​_FOLLOWING Undocumented
Constant UNBOUNDED​_PRECEDING Undocumented
Method __init__ Undocumented
Method ​_get​_limit​_offset​_params Undocumented
Method adapt​_datefield​_value Transform a date value to an object compatible with what is expected by the backend driver for date columns.
Method adapt​_decimalfield​_value Transform a decimal.Decimal value to an object compatible with what is expected by the backend driver for decimal (numeric) columns.
Method adapt​_ipaddressfield​_value Transform a string representation of an IP address into the expected type for the backend driver.
Method adapt​_unknown​_value Transform a value to something compatible with the backend driver.
Method autoinc​_sql Return any SQL needed to support auto-incrementing primary keys, or None if no SQL is necessary.
Method binary​_placeholder​_sql Some backends require special syntax to insert binary content (MySQL for example uses '_binary %s').
Method cache​_key​_culling​_sql Return an SQL query that retrieves the first cache key greater than the n smallest.
Method compiler Return the SQLCompiler class corresponding to the given name, in the namespace corresponding to the compiler_module attribute on this backend.
Method conditional​_expression​_supported​_in​_where​_clause Return True, if the conditional expression is supported in the WHERE clause.
Method convert​_durationfield​_value Undocumented
Method deferrable​_sql Return the SQL to make a constraint "initially deferred" during a CREATE TABLE statement.
Method distinct​_sql Return an SQL DISTINCT clause which removes duplicate rows from the result set. If any fields are given, only check the given fields for duplicates.
Method end​_transaction​_sql Return the SQL statement required to end a transaction.
Method execute​_sql​_flush Execute a list of SQL statements to flush the database.
Method explain​_query​_prefix Undocumented
Method fetch​_returned​_insert​_columns Given a cursor object that has just performed an INSERT...RETURNING statement into a table, return the newly created data.
Method field​_cast​_sql No summary
Method for​_update​_sql Return the FOR UPDATE SQL clause to lock rows for an update operation.
Method force​_no​_ordering Return a list used in the "ORDER BY" clause to force no ordering at all. Return an empty list to include nothing in the ordering.
Method ignore​_conflicts​_suffix​_sql Undocumented
Method last​_insert​_id Given a cursor object that has just performed an INSERT statement into a table that has an auto-incrementing ID, return the newly created ID.
Method limit​_offset​_sql Return LIMIT/OFFSET SQL clause.
Method lookup​_cast Return the string to use in a query when performing lookups ("contains", "like", etc.). It should contain a '%s' placeholder for the column being searched against.
Method max​_in​_list​_size Return the maximum number of items that can be passed in a single 'IN' list condition, or None if the backend does not impose a limit.
Method max​_name​_length Return the maximum length of table and column names, or None if there is no limit.
Method modify​_insert​_params Allow modification of insert parameters. Needed for Oracle Spatial backend due to #10888.
Method prep​_for​_like​_query Prepare a value for use in a LIKE query.
Method prepare​_sql​_script Take an SQL script that may contain multiple lines and return a list of statements to feed to successive cursor.execute() calls.
Method process​_clob Return the value of a CLOB column, for backends that return a locator object that requires additional processing.
Method regex​_lookup Return the string to use in a query when performing regular expression lookups (using "regex" or "iregex"). It should contain a '%s' placeholder for the column being searched against.
Method savepoint​_commit​_sql Return the SQL for committing the given savepoint.
Method savepoint​_create​_sql Return the SQL for starting a new savepoint. Only required if the "uses_savepoints" feature is True. The "sid" parameter is a string for the savepoint id.
Method savepoint​_rollback​_sql Return the SQL for rolling back the given savepoint.
Method sequence​_reset​_sql Return a list of the SQL statements required to reset sequences for the given models.
Method set​_time​_zone​_sql Return the SQL that will set the connection's time zone.
Method start​_transaction​_sql Return the SQL statement required to start a transaction.
Method tablespace​_sql Return the SQL that will be used in a query to define the tablespace.
Method unification​_cast​_sql Given a field instance, return the SQL that casts the result of a union to that type. The resulting string should contain a '%s' placeholder for the expression being cast.
Method validate​_autopk​_value Certain backends do not accept some values for "serial" fields (for example zero in MySQL). Raise a ValueError if the value is invalid, otherwise return the validated value.
Method window​_frame​_end Undocumented
Method window​_frame​_range​_start​_end Undocumented
Method window​_frame​_rows​_start​_end Return SQL for start and end points in an OVER clause window frame.
Method window​_frame​_start Undocumented
Method year​_lookup​_bounds​_for​_date​_field Return a two-elements list with the lower and upper bound to be used with a BETWEEN operator to query a DateField value using a year lookup.
Method year​_lookup​_bounds​_for​_datetime​_field Return a two-elements list with the lower and upper bound to be used with a BETWEEN operator to query a DateTimeField value using a year lookup.
Class Variable compiler​_module Undocumented
Class Variable integer​_field​_ranges Undocumented
Class Variable set​_operators Undocumented
Instance Variable ​_cache Undocumented
Instance Variable connection Undocumented
def _get_spatialite_func(self, func):
Helper routine for calling SpatiaLite functions and returning their result. Any error occurring in this method should be handled by the caller.
def convert_extent(self, box):
Convert the polygon data received from SpatiaLite to min/max values.
def geo_db_type(self, f):
Return None because geometry columns are added via the AddGeometryColumn stored procedure on SpatiaLite.
def geom_lib_version(self):
Return the version of the version-dependant geom library used by SpatiaLite.
def geos_version(self):
Return the version of GEOS used by SpatiaLite as a string.
def get_distance(self, f, value, lookup_type):
Return the distance parameters for the given geometry field, lookup value, and lookup type.
def get_geometry_converter(self, expression):
def lwgeom_version(self):
Return the version of LWGEOM library used by SpatiaLite.
def proj_version(self):
Return the version of the PROJ library used by SpatiaLite.
def rttopo_version(self):
Return the version of RTTOPO library used by SpatiaLite.
def spatial_aggregate_name(self, agg_name):
Return the spatial aggregate SQL template and function for the given Aggregate instance.
def spatialite_version(self):
Return the SpatiaLite library version as a string.
def spatialite_version_tuple(self):
Return the SpatiaLite version as a tuple (version string, major, minor, subminor).
collect: str =

Undocumented

extent: str =

Undocumented

gis_operators =

Undocumented

makeline: str =

Undocumented

name: str =

Undocumented

unionagg: str =

Undocumented

@cached_property
spatial_version =
Determine the version of the SpatiaLite library.