2014-08-18 01:06:25 +08:00
|
|
|
from django.db.backends.mysql.base import (
|
|
|
|
DatabaseWrapper as MySQLDatabaseWrapper,
|
|
|
|
DatabaseFeatures as MySQLDatabaseFeatures,
|
|
|
|
)
|
|
|
|
from django.contrib.gis.db.backends.base import BaseSpatialFeatures
|
2009-12-22 23:18:51 +08:00
|
|
|
from django.contrib.gis.db.backends.mysql.creation import MySQLCreation
|
2010-01-19 05:02:47 +08:00
|
|
|
from django.contrib.gis.db.backends.mysql.introspection import MySQLIntrospection
|
2009-12-22 23:18:51 +08:00
|
|
|
from django.contrib.gis.db.backends.mysql.operations import MySQLOperations
|
|
|
|
|
|
|
|
|
2014-08-18 01:06:25 +08:00
|
|
|
class DatabaseFeatures(BaseSpatialFeatures, MySQLDatabaseFeatures):
|
2014-08-20 00:11:10 +08:00
|
|
|
has_spatialrefsys_table = False
|
2014-08-22 00:47:57 +08:00
|
|
|
supports_distances_lookups = False
|
2014-08-21 20:26:49 +08:00
|
|
|
supports_transform = False
|
|
|
|
supports_real_shape_operations = False
|
|
|
|
supports_null_geometries = False
|
2014-08-20 00:47:23 +08:00
|
|
|
supports_num_points_poly = False
|
2014-08-18 01:06:25 +08:00
|
|
|
|
|
|
|
|
2013-10-27 11:57:08 +08:00
|
|
|
class DatabaseWrapper(MySQLDatabaseWrapper):
|
2009-12-22 23:18:51 +08:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super(DatabaseWrapper, self).__init__(*args, **kwargs)
|
2014-08-18 01:06:25 +08:00
|
|
|
self.features = DatabaseFeatures(self)
|
2009-12-22 23:18:51 +08:00
|
|
|
self.creation = MySQLCreation(self)
|
2011-04-06 19:19:37 +08:00
|
|
|
self.ops = MySQLOperations(self)
|
2010-01-19 05:02:47 +08:00
|
|
|
self.introspection = MySQLIntrospection(self)
|