Hi Fabien,

web2py is so well designed that it should not be hard to do what you ask, 
I've developed at least 4 public webapps with 95%+ of the "logic" code 
 being in the controller and the view containing ALL of the html 
bolierplate code, yes, you lose constructs like form.accepts() but you 
gain control of your application in my opinion. It definitely can be done, 
you need to change the development approach a bit though, not that one is 
better than the other but it has its advantages..

Julio

On Friday, March 2, 2012 10:03:37 AM UTC-8, fabien wrote:
>
> Hello, 
>
> I'm writing my first non-trivial web2py application, and I have a hard 
> time keeping my HTML boilerplate in views rather than in controllers. 
>
> More specifically, some of my FORMs feature a lot of fancy markup + 
> javascript.  Since they deal mostly with HTML, I'd rather put them in 
> HTML view templates; but I need to access them from the controller, to 
> perform the "form.accepts()" validation tests. 
>
> Is there a reasonable / preferred way to handle a FORM's lifecycle 
> (validation + handling of the POST request) in the controller, while 
> keeping its HTML content mostly in the view template? 
>

Reply via email to