

def requested_actor(app_label, actor):
    "\n    Utility function which returns the requested actor,\n    either directly or (if specified name is a model) that\n    model's default table.\n    "
    x = getattr(settings.SITE.modules, app_label, None)
    if (x is None):
        raise http.Http404(("There's no app_label %r here" % app_label))
    cl = getattr(x, actor, None)
    if (not isinstance(cl, type)):
        raise http.Http404(('%s.%s is not a class' % (app_label, actor)))
    if issubclass(cl, models.Model):
        return cl.get_default_table()
    if (not issubclass(cl, actors.Actor)):
        raise http.Http404(('%r is not an actor' % cl))
    return cl

dataset/ETHPy150Open lsaffre/lino/lino/core/views.py requested_actor/original