          # Make the definition (e.g. 'foo VARCHAR(30)') for this field.
          field_output = [style.SQL_FIELD(qn(f.column)),
              style.SQL_COLTYPE(col_type)]
          field_output.append(style.SQL_KEYWORD('%sNULL' % (not f.null and 'NOT ' or '')))
          if f.unique and (not f.primary_key or backend.allows_unique_and_pk):
              field_output.append(style.SQL_KEYWORD('UNIQUE'))
          if f.primary_key:
              field_output.append(style.SQL_KEYWORD('PRIMARY KEY'))
          if tablespace and backend.supports_tablespaces and (f.unique or f.primary_key) and backend.autoindexes_primary_keys:
              # We must specify the index tablespace inline, because we
 
</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 tablespace and backend.supports_tablespaces:
 </s> add             if tablespace and connection.features.supports_tablespaces: </s> remove         if f.db_index and not ((f.primary_key or f.unique) and backend.autoindexes_primary_keys):
 </s> add         if f.db_index and not ((f.primary_key or f.unique) and connection.features.autoindexes_primary_keys): </s> remove             if tablespace and backend.supports_tablespaces and backend.autoindexes_primary_keys:
 </s> add             if tablespace and connection.features.supports_tablespaces and connection.features.autoindexes_primary_keys: </s> remove     if opts.db_tablespace and backend.supports_tablespaces:
 </s> add     if opts.db_tablespace and connection.features.supports_tablespaces:
        if f.unique and (not f.primary_key or connection.features.allows_unique_and_pk):
          # Make the definition (e.g. 'foo VARCHAR(30)') for this field.
          field_output = [style.SQL_FIELD(qn(f.column)),
              style.SQL_COLTYPE(col_type)]
          field_output.append(style.SQL_KEYWORD('%sNULL' % (not f.null and 'NOT ' or '')))
        if f.unique and (not f.primary_key or connection.features.allows_unique_and_pk):
              field_output.append(style.SQL_KEYWORD('UNIQUE'))
          if f.primary_key:
              field_output.append(style.SQL_KEYWORD('PRIMARY KEY'))
          if tablespace and backend.supports_tablespaces and (f.unique or f.primary_key) and backend.autoindexes_primary_keys:
              # We must specify the index tablespace inline, because we
keep keep keep keep replace keep 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/core/management/sql.py