Monday, January 3, 2011

render_to_response

How formulate correctly the code below:

[code]
#views.py

def search(request):
..........
answ = my_fnc(roots)
return render_to_response("my_fnc.html", { "answ" : answ } )

def my_fnc( roots ):
FindWord=authors.objects.filter("name"__contains=roots)
return render_to_response("my_fnc.html", { " FindWord" :
FindWord } )

[code]

Gives error Manager isn't accessible via FindWord instances

I would like to get result of quesry in separate function.
How to return this result to initial function in view or print it to
*.html form from another function?

--
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