Updated Datastore API

1 view
Skip to first unread message

George Moschovitis

unread,
Oct 31, 2009, 4:32:03 AM10/31/09
to nitro-devel
I just pushed a new version of the appengine package featuring an
updated Datastore API. This API is as close to the Python API as I can
get it (If anyone has a better idea, by all means, let me know). It
works like this:

var db = require("google/appengine/ext/db");

var Category = db.Model("Category", {
label: new db.StringProperty(),
category: new db.ReferenceProperty({referenceClass: Category})
});

var c = new Category({keyName: "news", label: News"});
c.put();
var key = ...
var c1 = Category.get(key);
var c2 = Category.getByKeyName("news");
var categories = Category.all().limit(3).fetch();

var CustomCategory = Category.extend("CustomCategory", {
...
}

I also updated the blog-example to work with the latest code, and
demonstrate some new code (a datastore paginator, db/forms, etc).

-g.

Roberto Saccon

unread,
Oct 31, 2009, 8:16:44 AM10/31/09
to nitro-devel
Great, I like the db API much more now.

I just played with the blog example and observed the following
problems:

posting new articles is fine, dleting them also works, but when I
click on "edit", I get the "new article" UI and submitting results in
an error. And when I click on "comment" nothing happens.

regards
--
Roberto

On Oct 31, 9:32 am, George Moschovitis <george.moschovi...@gmail.com>
wrote:

George Moschovitis

unread,
Nov 1, 2009, 2:18:15 AM11/1/09
to nitro...@googlegroups.com
Great, I like the db API much more now.

Nice, if you have an idea how to better emulate the Python API, let me know.
 
posting new articles is fine, dleting them also works, but when I
click on "edit", I get the "new article" UI and submitting results in
an error. And when I click on "comment" nothing happens.

I 'll look into these.

Btw, I am working on more GAE API conversions (taskqueue, xmpp). I may even try to convert webapp.

If anyone has some free time, I would appreciate some help!

regards.
-g.


--
blog.gmosx.com
Reply all
Reply to author
Forward
0 new messages