3
I have a template called listaarquivos.html
where a table with information of an object of the models.py
called JOB
.
However, now I need to filter this table by date. I then inserted two inputs in the listaarquivos.html
, datainicial
and datafinal
, and a search button.
How do I get this information from the dates entered by the user the moment he clicks the search button, to filter these values in the database and return to the screen?
This is my view:
def listaarquivos(request):
ajob = Job.objects.order_by('nome_usuario').filter(status_job = 'OK - Impresso')
return render_to_response('listaarquivos.html', context_instance=RequestContext(request,{'ajob':ajob}))