Re: to execute executable.py from view.py
One more related question.
Is it possible to use string in views.py as a function ( string from
textarea (in search.html ))
i.e.
# search.html
<form>
<texarea name=''q" value={{query.0 | escape }}> input function name </
textarea>
<input type="submit", value="press", name="button1">
</form>
this search.html after being registered in urls.py shows input text
area.
I prompt to write the name of function.
I get this name as string in views.py in function def
search2(request):
query=request.GET.get('q',' ' )
i would like now to run this function, which was written in textarea,
i.e to run function Word.objects.all()
One of ways is to use Sqlite cursor and execute strings.
Another way is to use case type structure, which match function name
in string with function name in cases.
How to run this function, which was written in textarea as string,
without sqlite and case structures?
--
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home