示例#1
0
文件: datalayer.py 项目: happz/hlib
  def __getattr__(self, name):
    if name == 'is_admin':
      return self.admin == True

    if name == 'is_online':
      return self.name in hruntime.app.sessions.online_users

    return DBObject.__getattr__(self, name)
示例#2
0
文件: datalayer.py 项目: happz/hlib
  def __getattr__(self, name):
    if name == 'online_users':
      return hruntime.app.sessions.online_users

    return DBObject.__getattr__(self, name)