def get_sql_indexes_for_model(model):
 from django.db import backend
 output = []
 for f in model._meta.fields:
  if f.db_index:
   unique = ((f.unique and 'UNIQUE ') or '')
   output.append(((((((((style.SQL_KEYWORD(('CREATE %sINDEX' % unique)) + ' ') + style.SQL_TABLE(('%s_%s' % (model._meta.db_table, f.column)))) + ' ') + style.SQL_KEYWORD('ON')) + ' ') + style.SQL_TABLE(backend.quote_name(model._meta.db_table))) + ' ') + ('(%s);' % style.SQL_FIELD(backend.quote_name(f.column)))))
 return output

def get_sql_indexes_for_model ( model ) : from django . db import backend output = [ ] for f in model . _meta . fields : if f . db_index : unique = ( ( f . unique and 'UNIQUE ' ) or '' ) output . append ( ( ( ( ( ( ( ( ( style . SQL_KEYWORD ( ( 'CREATE %sINDEX' % unique ) ) + ' ' ) + style . SQL_TABLE ( ( '%s_%s' % ( model . _meta . db_table , f . column ) ) ) ) + ' ' ) + style . SQL_KEYWORD ( 'ON' ) ) + ' ' ) + style . SQL_TABLE ( backend . quote_name ( model . _meta . db_table ) ) ) + ' ' ) + ( '(%s);' % style . SQL_FIELD ( backend . quote_name ( f . column ) ) ) ) ) return output
returns the create index sql statements for a single model .