Thursday, November 29, 2012

calling the view function in the other view function

I have to call a function into another function which displays the
values from the database to the browser, like this:

def result(request):
zee = head.objects.aggregate(Max('id'))
mee = zee['id__max']
Head = head.objects.filter(id = mee)
return render_to_response('report/report_base.html',
{'Head':Head,},context_instance=RequestContext(request))

def result_cube(request):
Head = result(mee)
organisation = Organisation.objects.all().filter(id = 1)
return render_to_response('report/cube.html', { 'Head':Head,
'organisation':organisation},context_instance=RequestContext(request))

I want to call "result" view in the "result_cube", as it displays the
html data but not showing the data from the database.

--
Satinderpal Singh
http://satindergoraya.blogspot.in/
http://satindergoraya91.blogspot.in/

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment