Re: [web2py] Re: Validation of forms created in views
Hello, On 02-08-2013 00:54, Anthony wrote: I think you should be able to call form.process() in the view, though it's probably a better idea to do this in the controller. Can you show your code? I am planning to switch my old code from modpython to web2py. The problem is I have a complex form and new inputs are added/removed through jQuery. So I'm planning to write a Python function within the view and reuse it as necessary. However, I do not know how to validate these forms when they are submitted to controllers. Since the only way for validation that I know, is to use FORM() helper in the controller and call form.process().accepted. Since the code that I mentioned is similar, I pointed to it. Anthony On Thursday, August 1, 2013 11:12:22 AM UTC-4, Gökçen Eraslan wrote: Hello, I have a question about the validation of forms created in a view, such as this one in the admin application[1]. This form is submitted to upload_file function of the default controller here[2]. In such cases, we don't have a FORM() helper in the controller function[2], so we cannot validate that form using form.process().accepted, is that correct? So (besides the solution such as creating the form in the controller) how can we validate a form created in a view? There is a validator defined in the form, IS_NOT_EMPTY, but when and how exactly that validator is processed? (By the way I think there is a typo in the definition of this validator, I have filed a pull request about that [3].) Cheers. [1] https://github.com/web2py/web2py/blob/master/applications/admin/views/default/design.html#L23 [2] https://github.com/web2py/web2py/blob/master/applications/admin/controllers/default.py#L1341 [3] https://github.com/web2py/web2py/pull/154 -- Gökçen Eraslan -- Gökcen Eraslan -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Validation of forms created in views
Hello, I have a question about the validation of forms created in a view, such as this one in the admin application[1]. This form is submitted to upload_file function of the default controller here[2]. In such cases, we don't have a FORM() helper in the controller function[2], so we cannot validate that form using form.process().accepted, is that correct? So (besides the solution such as creating the form in the controller) how can we validate a form created in a view? There is a validator defined in the form, IS_NOT_EMPTY, but when and how exactly that validator is processed? (By the way I think there is a typo in the definition of this validator, I have filed a pull request about that [3].) Cheers. [1] https://github.com/web2py/web2py/blob/master/applications/admin/views/default/design.html#L23 [2] https://github.com/web2py/web2py/blob/master/applications/admin/controllers/default.py#L1341 [3] https://github.com/web2py/web2py/pull/154 -- Gökçen Eraslan -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Is web2py.com down today?
On Sun, Jun 30, 2013 at 2:07 AM, Alan Etkin wrote: > I can confirm it is down. Not sure why. I tried restart it but did not >> restart. I have emailed the pythonanywhere support. > > > It works! > > It seems it's still down. Any ideas? > Thanks > > -- > > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Gökçen Eraslan -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.