mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Began implementing BaseDatabaseOperations class for every database backend. This class will be used to hold the database-specific methods that currently live at the module level in each backend. Only autoinc_sql() has been implemented so far.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
		| @@ -4,7 +4,7 @@ MySQL database backend for Django. | ||||
| Requires MySQLdb: http://sourceforge.net/projects/mysql-python | ||||
| """ | ||||
|  | ||||
| from django.db.backends import BaseDatabaseWrapper, util | ||||
| from django.db.backends import BaseDatabaseWrapper, BaseDatabaseOperations, util | ||||
| from django.utils.encoding import force_unicode | ||||
| try: | ||||
|     import MySQLdb as Database | ||||
| @@ -63,7 +63,12 @@ class MysqlDebugWrapper: | ||||
|         else: | ||||
|             return getattr(self.cursor, attr) | ||||
|  | ||||
| class DatabaseOperations(BaseDatabaseOperations): | ||||
|     pass | ||||
|  | ||||
| class DatabaseWrapper(BaseDatabaseWrapper): | ||||
|     ops = DatabaseOperations() | ||||
|  | ||||
|     def __init__(self, **kwargs): | ||||
|         super(DatabaseWrapper, self).__init__(**kwargs) | ||||
|         self.server_version = None | ||||
| @@ -200,9 +205,6 @@ def get_max_name_length(): | ||||
| def get_start_transaction_sql(): | ||||
|     return "BEGIN;" | ||||
|  | ||||
| def get_autoinc_sql(table): | ||||
|     return None | ||||
|  | ||||
| def get_sql_flush(style, tables, sequences): | ||||
|     """Return a list of SQL statements required to remove all data from | ||||
|     all tables in the database (without actually removing the tables | ||||
|   | ||||
		Reference in New Issue
	
	Block a user