django-filters

'builtin_function_or_method' object has no attribute 'model'

'builtin_function_or_method' object has no attribute 'model' Question: I’m sorting by category and I get this error when starting the server. How to solve it? Error Image: https://i.stack.imgur.com/W4ROr.png filter/views.py from django.shortcuts import render from .filters import * from .forms import * # Create your views here. def filter(request): index_filter = IndexFilter(request.GET, queryset=all) context = { ‘index_filters’: …

Total answers: 1

How use MethodFilter from django-filter app?

How use MethodFilter from django-filter app? Question: I don’t know how to use MethodFilter in django-filter app and I can’t find it in the documentation (http://django-filter.readthedocs.org/en/latest/index.html). I need create filter with from and to input for date field. Do you have any idea how I can do this with MethodFilter or another way? I have …

Total answers: 4

Django Templates First element of a List

Django Templates First element of a List Question: I pass a dictionary to my Django Template, Dictionary & Template is like this – lists[listid] = {‘name’: l.listname, ‘docs’: l.userdocs.order_by(‘-id’)} {% for k, v in lists.items %} <ul><li>Count: {{ v.docs.count }}, First: {{ v.docs|first }}</li></ul> {% endfor %} Now docs is a list of userdocs type. …

Total answers: 3