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
because it is not supported in python 2.4 versions. But you are right. Who cares about 2.4 any more. On Tuesday, 24 July 2012 16:57:46 UTC-5, villas wrote: > > But why not this which seems much more readble? > > value = +1 if mode == 'plus' else -1 > > > > On Tuesday, July 24, 2012 10:20:51 PM UT

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
But why not this which seems much more readble? value = +1 if mode == 'plus' else -1 On Tuesday, July 24, 2012 10:20:51 PM UTC+1, pjryan126 wrote: > > I'm working through this same example, and I'm having trouble > understanding how the following resolves: > > value = (mode=='plus') and +1 or

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

2012-07-24 Thread Massimo Di Pierro
It is the same as in if mode == 'plus': value = +1 else: value = -1 On Tuesday, 24 July 2012 16:20:51 UTC-5, pjryan126 wrote: > > I'm working through this same example, and I'm having trouble > understanding how the following resolves: > > value = (mode=='plus') and +1 or -1 > > Can any

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

2012-07-24 Thread pjryan126
I'm working through this same example, and I'm having trouble understanding how the following resolves: value = (mode=='plus') and +1 or -1 Can anyone explain to me what is happening with this line of code? On Monday, March 26, 2012 10:28:27 AM UTC-4, Omi Chiba wrote: > > OK it worked ! > > Th

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

2012-03-26 Thread Omi Chiba
OK it worked ! The indent for last three line was wrong on book and it was fixed on the downloaded code. On Friday, March 23, 2012 6:18:36 PM UTC-5, Omi Chiba wrote: > > Alan, > > Thanks. Good idea. I will try the support files. > > > Sent from my Verizon Wireless BlackBerry > > -Origin

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

2012-03-23 Thread ochiba77
Alan, Thanks. Good idea. I will try the support files. 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.com Subject: [web2py] Re: Cookbook Chapter