Answers for "django-filter"

0

django-filter

from django_filters import rest_framework as filters

class ProductFilter(filters.FilterSet):
    class Meta:
        model = Product
        fields = ('field')
Posted by: Guest on May-10-2021
0

django-filter

def product_list(request):
    filter = ProductFilter(request.GET, queryset=Product.objects.all())
    return render(request, 'my_app/template.html', {'filter': filter})
Posted by: Guest on May-10-2021

Python Answers by Framework

Browse Popular Code Answers by Language