def get_cat_model(model):
    """
    Return a class from a string or class
    """
    try:
        if isinstance(model, string_types):
            model_class = apps.get_model(*model.split("."))
        elif issubclass(model, CategoryBase):
            model_class = model
        if model_class is None:
            raise TypeError
    except TypeError:
        raise TemplateSyntaxError("Unknown model submitted: %s" % model)
    return model_class
dataset/ETHPy150Open callowayproject/django-categories/categories/templatetags/category_tags.py/get_cat_model/original