  # warning module, and this is setup when the connection is created, and the
  # standard util.CursorDebugWrapper can be used. Also, using sql_mode
  # TRADITIONAL will automatically cause most warnings to be treated as errors.
  
  class DatabaseOperations(BaseDatabaseOperations):
      def date_extract_sql(self, lookup_type, field_name):
          # http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html
          return "EXTRACT(%s FROM %s)" % (lookup_type.upper(), field_name)
 
</s> remove         if tablespace and backend.supports_tablespaces and (f.unique or f.primary_key) and backend.autoindexes_primary_keys:
 </s> add         if tablespace and connection.features.supports_tablespaces and (f.unique or f.primary_key) and connection.features.autoindexes_primary_keys: </s> remove         if f.unique and (not f.primary_key or backend.allows_unique_and_pk):
 </s> add         if f.unique and (not f.primary_key or connection.features.allows_unique_and_pk):
class DatabaseFeatures(BaseDatabaseFeatures):
    autoindexes_primary_keys = False

  # warning module, and this is setup when the connection is created, and the
  # standard util.CursorDebugWrapper can be used. Also, using sql_mode
  # TRADITIONAL will automatically cause most warnings to be treated as errors.
  
class DatabaseFeatures(BaseDatabaseFeatures):
    autoindexes_primary_keys = False

  class DatabaseOperations(BaseDatabaseOperations):
      def date_extract_sql(self, lookup_type, field_name):
          # http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html
          return "EXTRACT(%s FROM %s)" % (lookup_type.upper(), field_name)
keep keep keep add keep keep keep keep
 Implemented BaseDatabaseFeatures and changed all code to access it -- connection.features.foo instead of backend.foo

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5974 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/db/backends/mysql/base.py