I went with the hidden fields, and it works very well. Thanks for your
assistance!
Vincent
On Jan 23, 2:06 pm, "Aidas Bendoraitis" <[EMAIL PROTECTED]>
wrote:
> 1. You can just have a hidden field defining the manipulator in each form.
>
> data = request.POST.copy()
> if data["hidden_field"] ==
1. You can just have a hidden field defining the manipulator in each form.
data = request.POST.copy()
if data["hidden_field"] == "reg1":
manipulator = RegistrMan1()
else:
manipulator = RegistrMan2()
or smth similar.
2. Or you can do as Alex has already told: set different action urls
fo
I imagine it would. However, what happens with repopulation of the
fields if validation fails? If my view is called subscription(), I
usually do something like:
def subscription(request):
...
if request.method == 'POST':
data = request.POST.copy()
errors = manipulator.get_validation
probably if there are 2 forms, must be 2 independent views.
so you define form action='' to point to each form view, and views
are returning this page. since you can not press both buttons
simultaneously this
approach should work well
--~--~-~--~~~---~--~~
You re
Hello everyone,
we are building a web application at work with Django, and one template
has two in it with their own submit button. If I have a
Manipulator for both kind of forms, how would I cleanly write my view?
Thanks,
Vincent.
--~--~-~--~~~---~--~~
You r
5 matches
Mail list logo