diff options
author | Ken Raffenetti <raffenet@mcs.anl.gov> | 2006-09-08 20:11:58 +0000 |
---|---|---|
committer | Ken Raffenetti <raffenet@mcs.anl.gov> | 2006-09-08 20:11:58 +0000 |
commit | 064b4ca0e8d28062dbd028ca61f79798b84e260b (patch) | |
tree | 6457009c86c631e38163bfda55e0a78a757c3088 /src/lib/Server/Hostbase/hostbase/views.py | |
parent | 77bb154d6526739dc111d576f3ccb2392e2a1832 (diff) | |
download | bcfg2-064b4ca0e8d28062dbd028ca61f79798b84e260b.tar.gz bcfg2-064b4ca0e8d28062dbd028ca61f79798b84e260b.tar.bz2 bcfg2-064b4ca0e8d28062dbd028ca61f79798b84e260b.zip |
minor updates
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2230 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Hostbase/hostbase/views.py')
-rw-r--r-- | src/lib/Server/Hostbase/hostbase/views.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/Server/Hostbase/hostbase/views.py b/src/lib/Server/Hostbase/hostbase/views.py index 299cc5829..c3b850442 100644 --- a/src/lib/Server/Hostbase/hostbase/views.py +++ b/src/lib/Server/Hostbase/hostbase/views.py @@ -10,6 +10,7 @@ from hostbase.models import * from Cheetah.Template import Template from datetime import date from django.db import connection +from django.shortcuts import render_to_response import re templatedir = '/usr/lib/python2.3/site-packages/Hostbase/hostbase/webtemplates' @@ -90,9 +91,7 @@ def search(request): cursor.execute(querystring) results = cursor.fetchall() - temp = Template(open('%s/results.html' % templatedir).read()) - temp.hosts = results - return HttpResponse(str(temp)) + return render_to_response('%s/results.html' % templatedir, {'hosts': results}) else: temp = Template(open('%s/search.html' % templatedir).read()) temp.TYPE_CHOICES = Interface.TYPE_CHOICES |