[web2py] SyntaxError: No such record: on MySQL

2011-01-06 Thread MicLee
Hi, I encountered the captioned error when I moved my app from GAE to MySQL +Apache. After a few tests I narrowed down to the following demo to replicate the error (the 'customer' table contains only one record: name='John', age=25): # Encounter exception if I use the 'shortcut' syntax to

[web2py] GAE appadmin update a record with an upload field

2010-11-08 Thread MicLee
Hi, On GAE, I use appadmin to update a record which includes an upload field. If I chose to retain the existing file, or delete it, a KeyError will be thrown. Tracing into the code I believed that the following patch is necessary: In sqlhtml.py:SQLFORM:accepts(), there is a block:

[web2py] GAE orderby reverse ID

2010-11-07 Thread MicLee
Hi, On GAE, .select(orderby=~db.table.id) is treated as .select(orderby=db.table.id) I think there are 2 parts in gql.py to be patched: In gql.py:Expression:__or__, the new Expression should be: return Expression((self.name if self.type!='id' else ('- __key__' if

[web2py] Re: GAE orderby multiple fields

2010-11-02 Thread MicLee
:                     items = items.order(order) I think web2py handles it correctly. Either there is a problem on the gae side or the indices have not been created. On Nov 1, 7:04 am, MicLee lmlll...@gmail.com wrote: Is it possible to order by multiple fields on GAE? I tried this (both title

[web2py] GAE orderby multiple fields

2010-11-01 Thread MicLee
Is it possible to order by multiple fields on GAE? I tried this (both title and subtitle are strings): pages = db().select(db.page.ALL,orderby=db.page.title| db.page.subtitle) But apparently the results are ordered by the title field only. Looking into the index.yaml, there is NO composite