I've suggested this before: During development (when you are changing perhaps often) It is harmless to ALWAYS add a pass: after an indented structure...
When you are done, you can return to remove the unnecessary {{pass}}'s.... This way - as you are adding / deleting / moving things around, you will not have this problem. Regards, Yarko On Sun, Nov 2, 2008 at 10:12 AM, mdipierro <[EMAIL PROTECTED]> wrote: > > you have > > for ...: > if ... : > elif...: > else: > pass > > the last {{pass}} closes the else and thus the if. You are not closing > the for loop. You need an additional {{pass}}. > > Massimo > > On Nov 2, 10:00 am, annet <[EMAIL PROTECTED]> wrote: > > I have got the following code in a view: > > > > <div id="cardright"> > > <table> > > {{for communication in communications:}} > > <tr> > > <td>{{=communication.communicatiemiddel}}:</td> > > <td>{{=communication.adres}}</td> > > </tr> > > {{pass}} > > </table> > > </div> > > > > which displays, telephone numbers, e-mail addresses etc. in a table. > > Now, I want to display the e-mail addresses and URLs as links instead > > of just text. > > > > I tried this: > > > > <table> > > {{for communication in communications:}} > > {{c=communication.communicatiemiddel}} > > {{if c=='T' or c=='F' or c=='M':}} > > <tr> > > <td>{{=c}}:</td> > > <td>{{=communication.adres}}</td> > > </tr> > > {{elif c=='E':}} > > <tr> > > <td>{{=c}}:</td> > > > > <td>{{=A(communication.adres,_href=URL(communication.adres))}}</td> > > </tr> > > {{else:}} > > <tr> > > <td>{{=c}}:</td> > > > > <td>{{=A(communication.adres,_href=URL(communication.adres))}}</td> > > </tr> > > {{pass}} > > </table> > > > > however, this results in a SyntaxError. According to page 116 of the > > web2py manual, something like this should work. Does one of you know > > why I get a SyntaxError on this code. > > > > Best regards, > > > > Annet. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---