#NEWLINE# def installed_models( self , tables ) : #NEWLINE# #INDENT# 'Returns a set of all models represented by the provided list of table names.' #NEWLINE# from django.db import models , router #NEWLINE# all_models = [ ] #NEWLINE# for app in models . get_apps ( ) : #NEWLINE# #INDENT# for model in models . get_models ( app ) : #NEWLINE# #INDENT# if router . allow_syncdb ( self . connection . alias , model ) : #NEWLINE# #INDENT# all_models . append ( self ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# tables = map ( self . table_name_converter , tables ) #NEWLINE# return set ( [ m for m in all_models if ( self . table_name_converter ( m . _meta . db_table ) in tables ) ] )