I have a template called listaarquivos.html
where a table with information about an object of models.py
called JOB
appears.
However, I now need to filter this table by date. I then inserted two inputs into 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}))