Random ...
 
December 2017
S M T W T F S
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Tags ...
Links



Linux++:::: web2py and Google appengine
Posted at 07.Apr,2011 15:13  Comments 0 / Trackbacks 0 / Like this post!
Technorati tag(s):

web2py is a python framework to do web stuff. It works quite well on its own.

And it works with gae with minimal modification; much of which is not web2py's fault.

Some points I encountered:

  • gae don't do joins, so:
          rows = db(db.person.id==db.cat.name).select()
    
      don't work.  We need to iterate and do this::
    
         rows = db(db.post.id > 0).select() 
         for row in rows: 
             comments = db(db.comment.post_id == row.id).select() 
       "ref":http://groups.google.com/group/web2py/browse_thread/thread/9807aa00f537d7e7/b04e38b9a38f3bba?lnk=gst&q=gae+join#b04e38b9a38f3bba
    
  • selects consume cpu cycle. tried caching query, not sure that worked:
        from gluon.contrib.gae_memcache import MemcacheClient
        cache.memcache = MemcacheClient(request)
        cache.ram = cache.disk = cache.memcache
    
        rows = db(db.person).select(cache=(cache.ram, 300))
    
  • web2py and gae sdk work pretty much like gae should be.

More to come


Bookmark and Share

Is this entry helpful? Comments/Donate/Click some google ads.  
Trackback is http://myzope.kedai.com.my/blogs/kedai/260/tbping 

Comments
Post a comment