0

In my html page I want to display latest jobs and popular jobs. In latest jobs I'm filtered based on posted date. Actually what I want means to display popular jobs also these can be filter by count depends on job title. Is this possible to passing multiple values to html page. Give me some idea

views.py  
def home(request):
    now=datetime.now()
    d=datetime(now.year, now.month, now.day)
    d1= d.strftime('%Y-%m-%d')
    latest = jobs.objects.filter(postdate__lte=d1).order_by('-postdate')
    return render_to_response('registration/home.html', {'latest': latest})


Can I use like this
return render_to_response('registration/home.html', {'latest': latest},{'popular':popular})

1 Answer 1

1

The context is a single dictionary:

render_to_response('registration/home.html', {'latest': latest, 'popular': popular})

This is really basic Python. You should do a tutorial.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.