base.py 751 B

1234567891011121314151617181920
  1. """
  2. TiDB database backend for Django. Based on django's MySQL backend
  3. Requires mysqlclient: https://pypi.python.org/pypi/mysqlclient/
  4. MySQLdb is supported for Python 2 only: http://sourceforge.net/projects/mysql-python
  5. """
  6. from django.db.backends.mysql import base as mybase
  7. # Some of these import MySQLdb, so import them after checking if it's installed.
  8. from .features import DatabaseFeatures # isort:skip
  9. from .schema import DatabaseSchemaEditor # isort:skip
  10. class DatabaseWrapper(mybase.DatabaseWrapper):
  11. SchemaEditorClass = DatabaseSchemaEditor
  12. def __init__(self, *args, **kwargs):
  13. super(DatabaseWrapper, self).__init__(*args, **kwargs)
  14. self.features = DatabaseFeatures(self)