I have just implemented Google AppEngine support in KalaPy. You can see a KalaPy example running on AppEngine.
As I mentioned earlier in my previous post, the DAL API has been changed to deal with GAE related issues. Let me make some corrections regarding these changes.
The
NOT IN operator has been removed (this can be done with multiple != filters). The OR operation should be
performed with Q like this:
from kalapy.db import Query, Q
from models import User
q1 = User.all().filter(Q('name ==', 'some')|Q('name ==', 'someone'))
q2 = User.all().filter('name ==', 'some') \
.filter('lang ==', 'fr_FR')
q1 is equivalent to:
SELECT * FROM "hello_user" WHERE "name" = 'some' OR "name" = 'someone'
q2 is equivalent to:
SELECT * FROM "hello_user" WHERE "name" = 'some' AND "lang" = 'fr_FR'
- Referential integrity is not implemented yet
- Unique constraint is not implemented yet
- OneToOne field will not work as expected
- Decimal field is not supported at the moment
- Transaction is not supported
Beside that, I have also implemented an admin command to deal with GAE related tasks like create
app.yaml, launching dev appserver, updating the application
on appengine etc.
$ cd /path/to/your-kalapy-project
$ ./admin.py gae --help
admin.py gae <action> [options] [args]
Perform google appengine specific tasks.
Use the 'appcfg.py' and 'dev_appserver.py' (included in appengine sdk)
for other appengine specific tasks.
options:
-a --address hostname for the appserver
-p --port port number for the appserver
-i --install install libs (extra libs as arguments)
-v --verbose enable verbose output
-h --help display help and exit
available actions:
prepare prepare this project for google appengine.
rollback launch 'appcfg.py rollback'
runserver launch 'dev_appserver.py runserver'
update launch 'appcfg.py update'
./admin.py gae prepare -i [module1 [module1 [...]]
command. For example, with KalaPy example application (change settings.DATABASE_ENGINE = "gae"):
$ cd /path/to/kalapy/example
$ ./admin.py gae prepare -i docutils roman
$ ./admin.py gae runserver
Regards
0 comments:
Post a Comment