def __getitem__(self, key): if key == "pid": return self.pid return db.hget(self.dbid, key)
def getUser(self): return User(db.hget("g:%s:usr" % self.gid, self.pid))
def fromName(obj, name): uid = db.hget("nameid", name) return obj(uid)
def __getitem__(self, key): return db.hget(self.dbid, key)
def getColor(self, pid): return db.hget(self.dbid + ":clr", pid)