#NEWLINE# def get_indexes( self , cursor , table_name ) : #NEWLINE# #INDENT# indexes = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for info in self . _table_info ( name , table_name ) : #NEWLINE# #INDENT# if ( info [ 'pk' ] != 0 ) : #NEWLINE# #INDENT# indexes [ info [ 'name' ] ] = { #NEWLINE# #INDENT# 'primary_key' : True , #NEWLINE# 'unique' : False , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# cursor . execute ( ( 'PRAGMA index_list(%s)' % self . connection . ops . quote_name ( table_name ) ) ) #NEWLINE# for ( index , unique ) in [ ( field [ 1 ] , field [ 2 ] ) for field in cursor . fetchall ( ) ] : #NEWLINE# #INDENT# cursor . execute ( ( 'PRAGMA index_info(%s)' % self . connection . ops . quote_name ( index ) ) ) #NEWLINE# info = cursor . fetchall ( ) #NEWLINE# if ( len ( info ) != 1 ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# name = info [ 0 ] [ 2 ] #NEWLINE# indexes [ name ] = { #NEWLINE# #INDENT# 'primary_key' : False , #NEWLINE# 'unique' : unique , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return indexes