Re: [web2py] Re: Why would I use DIV classes/helpers, over an html template?

2012-09-07 Thread pbreit
I would never/rarely do what Cliff describes. I generally put as little logic into the views as possible. That is totally perfectly fine with Web2py. But it's nice to have full Python available. It's basically the best of both worlds. If you need to have the templating literally forbid you from

Re: [web2py] Re: Why would I use DIV classes/helpers, over an html template?

2012-09-07 Thread Anthony
On Friday, September 7, 2012 3:21:30 PM UTC-4, luckysmack wrote: > > But see, to me, now that's putting HTML in the controller. Which I see as > a negative. Ideally I would pass the data to the view and use a foreach > over the data contents. And for marking a field as red, I would put some > me

Re: [web2py] Re: Why would I use DIV classes/helpers, over an html template?

2012-09-07 Thread Shawn McElroy
But see, to me, now that's putting HTML in the controller. Which I see as a negative. Ideally I would pass the data to the view and use a foreach over the data contents. And for marking a field as red, I would put some metadata into the data sent to the view. I would just test if vacant was true, a

[web2py] Re: Why would I use DIV classes/helpers, over an html template?

2012-09-07 Thread Andrew W
Good example Cliff. --

[web2py] Re: Why would I use DIV classes/helpers, over an html template?

2012-09-07 Thread Cliff Kachinske
Because you can do stuff like this: rows = db(...#get some arbitrary rows tbody = TBODY() for r in rows: tbody.append(TR(...# do complex stuff with row data. If a list of rental properties, for example, style the address red if vacant table=TABLE(THEAD(...arbitrary column headings), tbody) Th

[web2py] Re: Why would I use DIV classes/helpers, over an html template?

2012-09-06 Thread Anthony
You may find this helpful: http://stackoverflow.com/questions/8091487/what-are-the-benefits-of-building-html-markup-with-html-helpers-in-web2py/8095585#8095585 Anthony On Thursday, September 6, 2012 1:30:03 AM UTC-4, luckysmack wrote: > > Traditionally, for html templates, I would do something l

[web2py] Re: Why would I use DIV classes/helpers, over an html template?

2012-09-06 Thread Massimo Di Pierro
As others have already stated. This PHP ** *Hello * ** translates in this web2py: ** *Hello {{= name }}* ** You use helpers when html must be geneted programmatically to avoid concatenating strings which can cause XSS vulnerabilities. For example: {{=SELECT(*[OPTION(option) for optio