So, I have been thinking about this.

Right now, a block of python code (say 10 lines) in a HTML file will
have 4 ugly braces x10lines plus a pass embedded where needed. like:

{{for row in rows:}}
{{=row.name}}
{{pass}}
{{x=dict()}}
{{x['a']='strA'}}
{{x['b']='strB'}} and so on.

What if we could just have the double braces like this:

{{
    for row in rows:
        =row.names

   x=dict()
   x['a']='strA'
   x['b']='strB'

}}

I am sure there are some parser changes needed.... (gluon/
template.py?)

Regards
Anand





On Jan 11, 1:30 pm, JimK <[email protected]> wrote:
> Nor would you be able to use { some_text } in the static text of the
> HTML to display a line of code (e.g. javascript, java, actionscript,
> etc).
>
> On Jan 10, 8:33 pm, mdipierro <[email protected]> wrote:
>
> > Because you would not be able to use the template to generate JS code.
>
> > On Jan 10, 9:54 pm, Anand Vaidya <[email protected]> wrote:
>
> > > I was watching Cal Henderson's "Why I hate Django" talk on youtube
> > > yesterday. One of the issues he raises there is the presence of
> > > superfluous text in Django such as :
>
> > > {{  some_text }}
>
> > > web2py also uses {{ python_code }} in view files. Why do we need two
> > > braces? Will just one brace not do the job?
>
> > > Regards
> > > anand
-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to