So I have a view that does a queryset and returns a simple list:
def cdr(request):
queryset = CdrView.objects.all()
return object_list(request,
queryset = queryset,
template_name = "reports/cdrview_list.html",
paginate_by = 200,
page = request.GET.get('page', 1)
)
Initially, just to know if it works, I printed all the objects in "object_list" line by line in my template and it's OK but butt ugly. The problem is that my database is constantly growing and is currently at over a million objects. Each object (it's like a phone call) has source and destination among other attributes such as direction (in or out). In my template I call it by doing something like:
{{ call.src }} {{ call.dst }}
Since I'm fairly new in Django, I have a question on how I can make a form to be displayed at the top of my page where I an choose to see only calls that have direction as "in" or calls that have a source that starts with "xxxx". Basically filters.
Do I do most of the filtering in my views?
Or is it in my templates?
Thank you!