and app_config.label is contained in app_labels, create a tuple containing app_config.label and return value of the method router.get_migratable_models called with app_config, connection.alias and include_auto_created set to True, append the tuple to the list all_models. define the method model_installed with model as an argument.
def model_installed ( model ) :