Answer the question
In order to leave comments, you need to log in
How to filter date by range (Django_filters)?
It is necessary to make a field for filtering the date within the range that the user sets. Please let me know which one is easier.
class TYFilter(django_filters.FilterSet):
class Meta:
model = Technical_Y
fields = ['number_ty', 'date_ty', 'fullname']
def generalTY(request, number_z=None):
ty = Technical_Y.objects.filter(group=request_group)
filtered_ty = TYFilter(request.GET, queryset=Technical_Y.objects.all())
return render(request, 'ty.html', {'filtered_ty': filtered_ty, 'ty':ty})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question