Live data from Hacker News

Ask HN: Best Python Framework for Google App Engine?

news.ycombinator.com

41–48 of 48 posts

Re: Ask HN: Best Python Framework for Google App Engine?

#41
post #36

Earlier quoted context omitted.

Does the web2py database abstraction layer support datastore transactions and query cursors? Or what datastore features it doesn't support? (apparently the documentation doesn't mention any datastore feature it doesn't support but the last time I checked it did not support at least transactions)

I don't know, I haven't had to do transactions. Another advantage of the web2py DAL is that it doesn't have any dependencies. It's just a single file which could be used by any other web framework to decouple from BigTable and enhance portability. An Argentinian developer shows how easy it is to use the web2py DAL with Bottle: http://martin.tecnodoc.com.ar/default/post/2011/05/25/21_bot...

It should be added to the documentation which datastore features it doesn't support, to warn users and avoid that the GAE support is misinterpreted as bad advertisement.

Re: Ask HN: Best Python Framework for Google App Engine?

#42
post #36

For reasons that escape me, web2py doesn't seem to get much love, but deploying a web2py app to GAE takes all of 5 minutes. Web2py uses a DAL instead of an ORM, which means it's much easier to use the same data model on the non-relational datastore. (The inevitable restrictions imposed by BigTable still apply, see http://www.web2py.com/AlterEgo/default/show/138 ).

Does the web2py database abstraction layer support datastore transactions and query cursors? Or what datastore features it doesn't support? (apparently the documentation doesn't mention any datastore feature it doesn't support but the last time I checked it did not support at least transactions)

You can use the GAE datastore transaction with the web2py DAL but it does not provide an API with it, you have to use the GAE function for the transaction and than inside you can use DAL syntax. DAL automatically creates one cursor for you per http request. Each request has its own. It does not provide APIs to make your own cursors.

Re: Ask HN: Best Python Framework for Google App Engine?

#43

For reasons that escape me, web2py doesn't seem to get much love, but deploying a web2py app to GAE takes all of 5 minutes. Web2py uses a DAL instead of an ORM, which means it's much easier to use the same data model on the non-relational datastore. (The inevitable restrictions imposed by BigTable still apply, see http://www.web2py.com/AlterEgo/default/show/138 ).

Some have suggested it is because it originated from academia and not from industry. Tools originating from industry people assume they have already proven their values while tools originating from academia need to prove it.

Re: Ask HN: Best Python Framework for Google App Engine?

#44
post #36

Earlier quoted context omitted.

Does the web2py database abstraction layer support datastore transactions and query cursors? Or what datastore features it doesn't support? (apparently the documentation doesn't mention any datastore feature it doesn't support but the last time I checked it did not support at least transactions)

You can use the GAE datastore transaction with the web2py DAL but it does not provide an API with it, you have to use the GAE function for the transaction and than inside you can use DAL syntax. DAL automatically creates one cursor for you per http request. Each request has its own. It does not provide APIs to make your own cursors.

I think you're confusing the general idea of cursors with datastore cursors, which require a query and can't be created "per request", but "per query". See:

http://code.google.com/appengine/docs/java/datastore/queries...

Re: Ask HN: Best Python Framework for Google App Engine?

#45
post #44

Earlier quoted context omitted.

You can use the GAE datastore transaction with the web2py DAL but it does not provide an API with it, you have to use the GAE function for the transaction and than inside you can use DAL syntax. DAL automatically creates one cursor for you per http request. Each request has its own. It does not provide APIs to make your own cursors.

I think you're confusing the general idea of cursors with datastore cursors, which require a query and can't be created "per request", but "per query". See: http://code.google.com/appengine/docs/java/datastore/queries...

Sorry I misunderstood. Web2py has not API for it but it should be easy to add. If you open a ticket on google code, it will done sooner than later. ;-)

Re: Ask HN: Best Python Framework for Google App Engine?

#46
post #35

Earlier quoted context omitted.

You said it yourself. The Django ORM is designed for relational databases. Django-nonrel seems to work, but it's a second-class citizen in the Django world. Much of the appeal of Django resides in the ecosystem of pluggable apps, and most of them won't work or will fail subtly when running on GAE.

Okay, fair point about the third party apps. But even without them, it's not obvious to me that writing a Django-nonrel app from scratch is the worst option available.

I've tried django-nonrel as well - if you're not trying to get an existing django app running on app engine, I'd stay away from it. In practical experience, we saw our handlers taking 3-5 times longer when using Django-nonrel.

Re: Ask HN: Best Python Framework for Google App Engine?

#47

For reasons that escape me, web2py doesn't seem to get much love, but deploying a web2py app to GAE takes all of 5 minutes. Web2py uses a DAL instead of an ORM, which means it's much easier to use the same data model on the non-relational datastore. (The inevitable restrictions imposed by BigTable still apply, see http://www.web2py.com/AlterEgo/default/show/138 ).

Some have suggested it is because it originated from academia and not from industry. Tools originating from industry people assume they have already proven their values while tools originating from academia need to prove it.

I have the impression that experienced Python programmers don't feel comfortable with web2py's controversial (some would call "unpythonic") approaches, like automatic imports or the use or exec.

Re: Ask HN: Best Python Framework for Google App Engine?

#48
post #47

Earlier quoted context omitted.

Some have suggested it is because it originated from academia and not from industry. Tools originating from industry people assume they have already proven their values while tools originating from academia need to prove it.

I have the impression that experienced Python programmers don't feel comfortable with web2py's controversial (some would call "unpythonic") approaches, like automatic imports or the use or exec.

There are lots of popular python tools that do something very similar to web2py. For example visit, enthought, blender, pygame. "exec" is the only function that distinguish a purely interpreted language forma a compiled one and it is a powerful tool. I agree there are improper uses for exec but that is not the case of web2py. Web2py does have "automatic imports"; web2py exec(s) code in an predefined environment and that is the proper way to use exec. Those who criticize web2py for for this either do not undertand why we do it or are being partisan. I will agree that every design choice has pros and cons.
Post reply on HN