Skip to main content

get_callable

Return a callable corresponding to lookup_view. * If lookup_view is already a callable, return it. * If lookup_view is a string import path that can be resolved to a callable, import that callable and return it, otherwise raise an exception (ImportError or ViewDoesNotExist).

def get_callable(
lookup_view: string|callable
) - > callable

Return a callable corresponding to lookup_view.

  • If lookup_view is already a callable, return it.
  • If lookup_view is a string import path that can be resolved to a callable, import that callable and return it, otherwise raise an exception (ImportError or ViewDoesNotExist).

Parameters

NameTypeDescription
lookup_view`stringcallable`

Returns

TypeDescription
callableThe resolved callable object or the original function if already callable.