def likes(user, *models):
    """
    Usage:
        {% likes user as var %}
    Or
        {% likes user [model1, model2] as var %}
    """
    content_types = []
    model_list = models or settings.PINAX_LIKES_LIKABLE_MODELS.keys()
    for model in model_list:
        if not _allowed(model):
            continue
        app, model = model.split(".")
        content_types.append(
            ContentType.objects.get(app_label=app, model__iexact=model)
        )
    return Like.objects.filter(sender=user, receiver_content_type__in=content_types)
def likes ( user , * models ) : content_types = [ ] model_list = models or settings . PINAX_LIKES_LIKABLE_MODELS . keys ( ) for model in model_list : if not _allowed ( model ) : continue app , model = model . split ( "." ) content_types . append ( ContentType . objects . get ( app_label = app , model__iexact = model ) ) return Like . objects . filter ( sender = user , receiver_content_type__in = content_types )
Usage:
        {% likes user as var %}
    Or
        {% likes user [model1, model2] as var %}