Re: [web2py] Re: Cookbook Chapter 2 - Reddit clone Ajax problem

2012-07-25 Thread villas
Right, I wondered why. I also found this code in layout to be a 'challenge': middle_columns = {0:'span12',1:'span9',2:'span6'}[ (left_sidebar_enabled and 1 or 0)+(right_sidebar_enabled and 1 or 0)] }} It took me a while to figure out what was going on there -- it seems very clever and c

Re: [web2py] Re: Cookbook Chapter 2 - Reddit clone Ajax problem

2012-07-24 Thread Massimo Di Pierro
gt;>> > {{extend 'layout.html'}} >>>> > {{=A(news.title, _href=news.link)}} >>>> > {{if auth.user:}} >>>> > {{=news.votes}} >>>> > plus >>>> > minus >>>> > {{=form}} >>>&g

Re: [web2py] Re: Cookbook Chapter 2 - Reddit clone Ajax problem

2012-07-24 Thread Jonathan Lundell
On 24 Jul 2012, at 2:57 PM, villas wrote: > But why not this which seems much more readble? > > value = +1 if mode == 'plus' else -1 Originally for compatibility with Python 2.4. Not sure how much of a priority that is these days... > > > > On Tuesday, July 24, 2012 10:20:51 PM UTC+1, pjryan

Re: [web2py] Re: Cookbook Chapter 2 - Reddit clone Ajax problem

2012-07-24 Thread villas
gt; Sent from my Verizon Wireless BlackBerry >>> >>> -Original Message- >>> From: Alan Etkin >>> Sender: web2py@googlegroups.com >>> Date: Fri, 23 Mar 2012 15:22:25 >>> To: web2py-users> >>> Reply-To: web2py@googlegroups

Re: [web2py] Re: Cookbook Chapter 2 - Reddit clone Ajax problem

2012-07-24 Thread Massimo Di Pierro
Verizon Wireless BlackBerry >>> >>> -Original Message- >>> From: Alan Etkin >>> Sender: web2py@googlegroups.com >>> Date: Fri, 23 Mar 2012 15:22:25 >>> To: web2py-users> >>> Reply-To: web2py@googlegroups.com >>

Re: [web2py] Re: Cookbook Chapter 2 - Reddit clone Ajax problem

2012-07-24 Thread pjryan126
>> >> >> Sent from my Verizon Wireless BlackBerry >> >> -Original Message- >> From: Alan Etkin >> Sender: web2py@googlegroups.com >> Date: Fri, 23 Mar 2012 15:22:25 >> To: web2py-users> >> Reply-To: web2py@googlegroups.co

Re: [web2py] Re: Cookbook Chapter 2 - Reddit clone Ajax problem

2012-03-26 Thread Omi Chiba
n Wireless BlackBerry > > -Original Message- > From: Alan Etkin > Sender: web2py@googlegroups.com > Date: Fri, 23 Mar 2012 15:22:25 > To: web2py-users> > Reply-To: web2py@googlegroups.com > Subject: [web2py] Re: Cookbook Chapter 2 - Reddit clone Ajax problem > > I

Re: [web2py] Re: Cookbook Chapter 2 - Reddit clone Ajax problem

2012-03-23 Thread ochiba77
Chapter 2 - Reddit clone Ajax problem I tested the example app with the book support files and it worked (with Firefox 10 and web2py trunk). Maybe there is a bug fixed in the app code that was not updated in the book's text. On 23 mar, 18:11, Omi Chiba wrote: > I was following cookbook and

[web2py] Re: Cookbook Chapter 2 - Reddit clone Ajax problem

2012-03-23 Thread Alan Etkin
I tested the example app with the book support files and it worked (with Firefox 10 and web2py trunk). Maybe there is a bug fixed in the app code that was not updated in the book's text. On 23 mar, 18:11, Omi Chiba wrote: > I was following cookbook and having a problem for the ajax part. I can >