Hi,

I have the following view which throws the error "The view
TCDB.viewdb.views.dbout didn't return an HttpResponse object." I have
tried various indentation for the return statement. But it doesn't
seem to help. Can somebody help?

def dbout(request):
 try:
  filter_string= request.GET.get('filter_string', '')
  table_name=request.GET.get('table_name','')
  field_name=request.GET.get('field_name','')
  if field_name=='hostid':
   results=eval(table_name).objects.filter(hostid__icontains=str
(filter_string)).values()
  elif field_name=='hostname':
   results=eval(table_name).objects.filter(hostname__icontains=str
(filter_string)).values()
  elif field_name=='plat_manu_name':
   results=eval(table_name).objects.filter
(plat_manu_name__icontains=str(filter_string)).values()
  elif field_name=='mac':
   results=eval(table_name).objects.filter(mac__icontains=str
(filter_string)).values()
  return HttpResponse('No Exception')
 except:
  return HttpResponse('Exception Reached')


Thanks,
~Ashok.

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

Reply via email to