def lazy_related_operation(function, model, *related_models, **kwargs):
 models = ([model] + [resolve_relation(model, rel) for rel in related_models])
 model_keys = (make_model_tuple(m) for m in models)
 apps = model._meta.apps
 return apps.lazy_model_operation(partial(function, **kwargs), *model_keys)

def lazy_related_operation ( function , model , * related_models , ** kwargs ) : models = ( [ model ] + [ resolve_relation ( model , rel ) for rel in related_models ] ) model_keys = ( make_model_tuple ( m ) for m in models ) apps = model . _meta . apps return apps . lazy_model_operation ( partial ( function , ** kwargs ) , * model_keys )
schedule function to be called once model and all related_models have been imported and registered with the app registry .