Re: Template with multiple elements and manipulators

2007-01-24 Thread [EMAIL PROTECTED]
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"] ==

Re: Template with multiple elements and manipulators

2007-01-23 Thread Aidas Bendoraitis
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

Re: Template with multiple elements and manipulators

2007-01-23 Thread [EMAIL PROTECTED]
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

Re: Template with multiple elements and manipulators

2007-01-22 Thread [EMAIL PROTECTED]
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

Template with multiple elements and manipulators

2007-01-22 Thread [EMAIL PROTECTED]
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