Skip to content

Commit

Permalink
Updated README, show new DB api, added users api example.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmosx committed Oct 31, 2009
1 parent e916382 commit 9b10a05
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions README.md
Expand Up @@ -20,9 +20,10 @@ This library is under construction but usable. Substantial parts of the Python A
* google/appengine/api/urlfetch: 80% (usable)
* google/appengine/api/mail: 60% (usable)
* google/appengine/api/images: 40% (usable)
* google/appengine/api/users: 10%
* google/appengine/ext/db: 60% (usable, expect minor API changes)
* google/appengine/api/users: 80% (usable)
* google/appengine/ext/db: 80% (usable, expect minor API changes)
* google/appengine/ext/db/forms: 30% (expect API changes)
* google/appengine/api/lab/taskqueue: 10%


Datastore
Expand All @@ -32,20 +33,12 @@ The Python ext/db api is supported. The API is slightly different to better fit

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

var Category = function(term, label, category) {
this.term = term;
this.label = label;
this.category = category;
this.__key__ = db.key({kind: this.constructor.kind(), name: term});
}

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

var c = new Category("news", News");
var c = new Category({keyName: "news", label: News"});
c.put();
var key = ...
var c1 = Category.get(key);
Expand Down Expand Up @@ -85,6 +78,20 @@ Memcache
}


Users
-----

var users = require("google/appengine/api/users");

var user = users.getCurrentUser();

if (users.isCurrentUserAdmin()) {
...
}

var url = user.createLoginURL();


Example
-------

Expand Down

0 comments on commit 9b10a05

Please sign in to comment.