django: Is it possible to create a form "on the fly"?
Hi!
I'm wondering if it's possible to create a form on the fly? I mean, instead of having a class extend a form defining the fields in the form, is it possible to create it manually so that the form code can be retrieved for an HTML page and checked on submittal? |
Since this has gone unanswered for a few days, I'll take a shot, with the proviso that I'm a full-on Django newbie.
Since you can return anything you want as an HttpResponse object in your views.py module, I'll say 'sure'. Whatever HTML your view class can generate should work. Whether this is considered good form (bad pun intended) is another matter. But really, you can also use iteration in templates, so I don't understand why that wouldn't be just as good; probably even better. --- rod. |
I'm going to say yes, even though I don't understand the following:
Quote:
|
I mean using a form to create the html code for the given for and be able to use the form to do the checks when the form is "POSTED", so to speak. And it can be done... or at least, it has worked for me. Check http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/
|
All times are GMT -5. The time now is 11:14 PM. |