1π
i sovled,
evertything was becuse i am a new π
i donβt know that i need pass a context with data to view in inclusion tag, for that a tag should be like that
from django import template from dls.apps.products.models import Art from dls.apps.userprofiles.models import Artist `from django.shortcuts import redirect, get_object_or_404
register = template.Library();
@register.inclusion_tag('shop/templatetags/product_by_art.html', takes_context=True) def partart(context,data): user = get_object_or_404(Artist,user__username=data); all_prod = Art.objects.filter(user__id=user.id,active=True); return {'all': all_prod, 'request': context['request']}
context as a function parameter and request
Sorry for trouble, i must teach a liite more π
π€PiotroSan
Source:stackexchange.com