def json(self): result = self.modify(Activity.get(db.Key(self.require("key")))) if result: result.put() return {"activity":render("activity", activity=result)} return {}
def json(self): activity = Activity(name=self.require("name"), user=user(), tags=Activity.parsetags(self.request.get("tags", ""))) activity.put() return {"activity":render("activity", activity=activity)}