summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2017-09-06 09:29:11 +0500
committerTim Graham <timograham@gmail.com>2017-09-06 10:13:43 -0400
commit34f27f910b2a6368e3c23324b92e6a35a4ddae3a (patch)
tree03b7717340a5982da29398e369988b9dcf034959
parent690fc30d4426549a7b419e4104449bb2f2226697 (diff)
Replaced @cached_property with class attributes where possible.
-rw-r--r--django/contrib/gis/db/backends/postgis/operations.py5
-rw-r--r--django/contrib/gis/db/backends/spatialite/operations.py20
-rw-r--r--django/db/backends/sqlite3/features.py26
3 files changed, 17 insertions, 34 deletions
diff --git a/django/contrib/gis/db/backends/postgis/operations.py b/django/contrib/gis/db/backends/postgis/operations.py
index 40860b3d0e..85e1f35fe1 100644
--- a/django/contrib/gis/db/backends/postgis/operations.py
+++ b/django/contrib/gis/db/backends/postgis/operations.py
@@ -134,10 +134,7 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
unsupported_functions = set()
- @cached_property
- def select(self):
- return '%s::bytea'
-
+ select = '%s::bytea'
select_extent = None
def __init__(self, connection):
diff --git a/django/contrib/gis/db/backends/spatialite/operations.py b/django/contrib/gis/db/backends/spatialite/operations.py
index 69dc3b99f6..c0ee23124d 100644
--- a/django/contrib/gis/db/backends/spatialite/operations.py
+++ b/django/contrib/gis/db/backends/spatialite/operations.py
@@ -68,17 +68,15 @@ class SpatiaLiteOperations(BaseSpatialOperations, DatabaseOperations):
def select(self):
return 'CAST (AsEWKB(%s) AS BLOB)' if self.spatial_version >= (4, 3, 0) else 'AsText(%s)'
- @cached_property
- def function_names(self):
- return {
- 'Length': 'ST_Length',
- 'LineLocatePoint': 'ST_Line_Locate_Point',
- 'NumPoints': 'ST_NPoints',
- 'Reverse': 'ST_Reverse',
- 'Scale': 'ScaleCoords',
- 'Translate': 'ST_Translate',
- 'Union': 'ST_Union',
- }
+ function_names = {
+ 'Length': 'ST_Length',
+ 'LineLocatePoint': 'ST_Line_Locate_Point',
+ 'NumPoints': 'ST_NPoints',
+ 'Reverse': 'ST_Reverse',
+ 'Scale': 'ScaleCoords',
+ 'Translate': 'ST_Translate',
+ 'Union': 'ST_Union',
+ }
@cached_property
def unsupported_functions(self):
diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py
index c82d565b6e..a68633836d 100644
--- a/django/db/backends/sqlite3/features.py
+++ b/django/db/backends/sqlite3/features.py
@@ -31,25 +31,13 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_temporal_subtraction = True
ignores_table_name_case = True
supports_cast_with_precision = False
-
- @cached_property
- def uses_savepoints(self):
- return Database.sqlite_version_info >= (3, 6, 8)
-
- @cached_property
- def supports_index_column_ordering(self):
- return Database.sqlite_version_info >= (3, 3, 0)
-
- @cached_property
- def can_release_savepoints(self):
- return self.uses_savepoints
-
- @cached_property
- def can_share_in_memory_db(self):
- return (
- Database.__name__ == 'sqlite3.dbapi2' and
- Database.sqlite_version_info >= (3, 7, 13)
- )
+ uses_savepoints = Database.sqlite_version_info >= (3, 6, 8)
+ supports_index_column_ordering = Database.sqlite_version_info >= (3, 3, 0)
+ can_release_savepoints = uses_savepoints
+ can_share_in_memory_db = (
+ Database.__name__ == 'sqlite3.dbapi2' and
+ Database.sqlite_version_info >= (3, 7, 13)
+ )
@cached_property
def supports_stddev(self):