class documentation

Undocumented

Method convert_extent Return a 4-tuple extent for the `Extent` aggregate by converting the bounding box text returned by PostGIS (`box` argument), for example: "BOX(-90.0 30.0, -85.0 40.0)".
Method convert_extent3d Return a 6-tuple extent for the `Extent3D` aggregate by converting the 3d bounding-box text returned by PostGIS (`box3d` argument), for example: "BOX3D(-90.0 30.0 1, -85.0 40.0 2)".
Method distance_expr_for_lookup Undocumented
Method geo_db_type Return the database field type for the given spatial field.
Method geometry_columns Undocumented
Method get_area_att_for_field Undocumented
Method get_distance Retrieve the distance parameters for the given geometry field, distance lookup value, and the distance lookup type.
Method get_geom_placeholder Provide a proper substitution value for Geometries or rasters that are not in the SRID of the field. Specifically, this routine will substitute in the ST_Transform() function call.
Method get_geometry_converter Undocumented
Method parse_raster Convert a PostGIS HEX String into a dict readable by GDALRaster.
Method postgis_full_version Return PostGIS version number and compile-time options.
Method postgis_geos_version Return the version of the GEOS library used with PostGIS.
Method postgis_lib_version Return the version number of the PostGIS library used with PostgreSQL.
Method postgis_proj_version Return the version of the PROJ library used with PostGIS.
Method postgis_version Return PostGIS version number and compile-time options.
Method postgis_version_tuple Return the PostGIS version as a tuple (version string, major, minor, subminor).
Method proj_version_tuple Return the version of PROJ used by PostGIS as a tuple of the major, minor, and subminor release numbers.
Method spatial_aggregate_name Undocumented
Method spatial_ref_sys Undocumented
Class Variable collect Undocumented
Class Variable extent Undocumented
Class Variable extent3d Undocumented
Class Variable geom_func_prefix Undocumented
Class Variable gis_operators Undocumented
Class Variable length3d Undocumented
Class Variable makeline Undocumented
Class Variable name Undocumented
Class Variable perimeter3d Undocumented
Class Variable postgis Undocumented
Class Variable select Undocumented
Class Variable select_extent Undocumented
Class Variable unionagg Undocumented
Class Variable unsupported_functions Undocumented
Property function_names Undocumented
Property spatial_version Determine the version of the PostGIS library.
Static Method _normalize_distance_lookup_arg Undocumented
Method _get_postgis_func Helper routine for calling PostGIS functions and returning their result.

Inherited from BaseSpatialOperations:

Method check_expression_support Undocumented
Method geo_quote_name Undocumented
Method get_db_converters Undocumented
Method get_distance_att_for_field Undocumented
Method spatial_function_name Undocumented
Class Variable disallowed_aggregates Undocumented
Class Variable from_text Undocumented
Class Variable mariadb Undocumented
Class Variable mysql Undocumented
Class Variable oracle Undocumented
Class Variable spatialite Undocumented

Inherited from DatabaseOperations (via BaseSpatialOperations):

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_datetimefield_value Transform a datetime value to an object compatible with what is expected by the backend driver for datetime 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_timefield_value Transform a time value to an object compatible with what is expected by the backend driver for time columns.
Method bulk_insert_sql Undocumented
Method date_extract_sql Given a lookup_type of 'year', 'month', or 'day', return the SQL that extracts a value from the given date field 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 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 explain_query_prefix Undocumented
Method fetch_returned_insert_rows Given a cursor object that has just performed an INSERT...RETURNING statement into a table, return the tuple of returned data.
Method last_executed_query Return a string of the query last executed by the given cursor, with placeholders replaced with actual values.
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_name_length Return the maximum length of an identifier.
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 on_conflict_suffix_sql Undocumented
Method prep_for_iexact_query Undocumented
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 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 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 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 tablespace_sql Return the SQL that will be used in a query to define the tablespace.
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.
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.
Class Variable cast_char_field_without_max_length Undocumented
Class Variable cast_data_types Undocumented
Class Variable explain_options Undocumented
Class Variable explain_prefix Undocumented
Method _convert_sql_to_tz Undocumented
Method _prepare_tzname_delta Undocumented

Inherited from BaseDatabaseOperations (via BaseSpatialOperations, DatabaseOperations):

Method __init__ Undocumented
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 bulk_batch_size Return the maximum allowed batch size for the backend. The fields are the fields going to be inserted in the batch, the objs contains all the objects to be inserted.
Method cache_key_culling_sql Return an SQL query that retrieves the first cache key greater than the n smallest.
Method combine_duration_expression Undocumented
Method combine_expression Combine a list of subexpressions into a single expression, using the provided connecting operator. This is required because operators can vary between backends (e.g., Oracle with %% and &) and between subexpression types (e...
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 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 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 Given a column type (e.g. 'BLOB', 'VARCHAR') and an internal type (e.g. 'GenericIPAddressField'), return the SQL to cast it before using it in a WHERE statement. The resulting string should contain a '%s' placeholder for the column being searched against.
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 format_for_duration_arithmetic 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_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 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 modify_insert_params Allow modification of insert parameters. Needed for Oracle Spatial backend due to #10888.
Method pk_default_value Return the value to use during an INSERT statement to specify that the field should use its default value.
Method prep_for_like_query Prepare a value for use in a LIKE query.
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 start_transaction_sql Return the SQL statement required to start a transaction.
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.
Constant CURRENT_ROW Undocumented
Constant FOLLOWING Undocumented
Constant PRECEDING Undocumented
Constant UNBOUNDED_FOLLOWING Undocumented
Constant UNBOUNDED_PRECEDING Undocumented
Class Variable compiler_module Undocumented
Class Variable integer_field_ranges Undocumented
Class Variable set_operators Undocumented
Instance Variable connection Undocumented
Method _get_limit_offset_params Undocumented
Instance Variable _cache Undocumented
def convert_extent(self, box): (source)

Return a 4-tuple extent for the `Extent` aggregate by converting the bounding box text returned by PostGIS (`box` argument), for example: "BOX(-90.0 30.0, -85.0 40.0)".

def convert_extent3d(self, box3d): (source)

Return a 6-tuple extent for the `Extent3D` aggregate by converting the 3d bounding-box text returned by PostGIS (`box3d` argument), for example: "BOX3D(-90.0 30.0 1, -85.0 40.0 2)".

def distance_expr_for_lookup(self, lhs, rhs, **kwargs): (source)
def geo_db_type(self, f): (source)

Return the database field type for the given spatial field.

def get_distance(self, f, dist_val, lookup_type): (source)

Retrieve the distance parameters for the given geometry field, distance lookup value, and the distance lookup type. This is the most complex implementation of the spatial backends due to what is supported on geodetic geometry columns vs. what's available on projected geometry columns. In addition, it has to take into account the geography column type.

def get_geom_placeholder(self, f, value, compiler): (source)

Provide a proper substitution value for Geometries or rasters that are not in the SRID of the field. Specifically, this routine will substitute in the ST_Transform() function call.

def parse_raster(self, value): (source)

Convert a PostGIS HEX String into a dict readable by GDALRaster.

def postgis_full_version(self): (source)

Return PostGIS version number and compile-time options.

def postgis_geos_version(self): (source)

Return the version of the GEOS library used with PostGIS.

def postgis_lib_version(self): (source)

Return the version number of the PostGIS library used with PostgreSQL.

def postgis_proj_version(self): (source)

Return the version of the PROJ library used with PostGIS.

def postgis_version(self): (source)

Return PostGIS version number and compile-time options.

def postgis_version_tuple(self): (source)

Return the PostGIS version as a tuple (version string, major, minor, subminor).

def proj_version_tuple(self): (source)

Return the version of PROJ used by PostGIS as a tuple of the major, minor, and subminor release numbers.

Undocumented

Undocumented

extent3d = (source)

Undocumented

gis_operators = (source)

Undocumented

length3d = (source)

Undocumented

makeline = (source)

Undocumented

Undocumented

perimeter3d = (source)

Undocumented

unionagg = (source)

Undocumented

@staticmethod
def _normalize_distance_lookup_arg(arg): (source)

Undocumented

def _get_postgis_func(self, func): (source)

Helper routine for calling PostGIS functions and returning their result.