def get_groups(self, keys=None): q = GroupDb.all() if keys is not None: q = q.get(keys) return q
def add_group(self, name, description, owner): g = GroupDb(owner=owner, name=name, description=description) return g.put()
def get_group(self, id): return GroupDb.get_by_id(id)
def is_group_name_unique(self, name, key=None): q = GroupDb.all().filter('name =', name) if key is not None: q = q.filter('__key__ !=', key) return q.count(1) == 0
def is_group_name_unique(self, name, key=None): q = GroupDb.all().filter("name =", name) if key is not None: q = q.filter("__key__ !=", key) return q.count(1) == 0