Ejemplo n.º 1
0
def queryAge(aid):
    try:
        intid = int(aid)
        age = dict(db.where('ages', id=aid)[0])
    except:
        age = dict(db.where('ages', shortname=aid)[0])
    age['author'] = userdb.queryUser(age['creator'])
    age['author']['uri'] = config.users_path + '/' + str(age['creator'])
    # Once the author dict is filled, creator is redundant, and not part of
    # the public API
    del age['creator']
    return age
Ejemplo n.º 2
0
Archivo: agedb.py Proyecto: H-uru/agedb
def queryAge(aid):
    try:
        intid = int(aid)
        age = dict(db.where('ages', id=aid)[0])
    except:
        age = dict(db.where('ages', shortname=aid)[0])
    age['author'] = userdb.queryUser(age['creator'])
    age['author']['uri'] = config.users_path+'/'+str(age['creator'])
    # Once the author dict is filled, creator is redundant, and not part of
    # the public API
    del age['creator']
    return age
Ejemplo n.º 3
0
Archivo: users.py Proyecto: H-uru/agedb
 def GET(self, uid):
     try:
         return userdb.queryUser(uid)
     except IndexError:
         raise web.NotFound("The requested user does not exist")