How to use the querylist object in Django template -


initially had code

(r'^list/fixed/$', list_detail.object_list, fixedlist)

in template use

{% val in object_list %}

it worked fine used generic list

but want write own view same

 object_list = model.objects.all()  return render_to_response('lists.html', object_list) 

but not working.

how can pass same object list template in generic view

render_to_response() takes dictionary of variables use.

return render_to_response('lists.html', {'object_list': object_list}) 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -