views:

44

answers:

2

What would be the correct statements for the below two.I want to send the base variable to my template which keeps varying but there will be an error if i send {'form': form,'msg' : msg} in the second statement

return render_to_response('chatlist/newchat.html', context_instance=RequestContext(request,{'form': form,'msg' : msg}),extra_context = { "base": "base/chatbase.html" })

or

return object_list(request,{'form': form,'msg' : msg}, template_name='chatlist/newchat.html',extra_context = { "base": "base/chatbase.html" } )
A: 

As far as i know (but not certainly sure), object_list is used for generic views...

Here is the info about generic views and how it is used...

And here is the tutor section about their usage and adventages...

FallenAngel
+1  A: 

Try adding these to extra_context:

extra_context = { "base": "base/chatbase.html", 'form': form, 'msg' : msg }  
Seitaridis
I had tried but there is an error as _clone ............
Rajeev
Could you post the error message? That will be helpful.
Seitaridis