Ejemplo n.º 1
0
 def GET(self, sitename):
     i = server.input('key')
     author_id = get_thing_id(i.key)
     return (get_db().query(
         "SELECT count(*) as count FROM transaction WHERE author_id=$author_id",
         vars=locals(),
     )[0].count)
Ejemplo n.º 2
0
 def GET(self, sitename):
     i = server.input('olid')
     d = get_db().query(
         'SELECT key FROM thing WHERE get_olid(key) = $i.olid',
         vars=locals())
     key = d and d[0].key or None
     return {'olid': i.olid, 'key': key}
Ejemplo n.º 3
0
 def GET(self, sitename):
     i = server.input("olid")
     d = get_db().query(
         "SELECT key FROM thing WHERE get_olid(key) = $i.olid",
         vars=locals())
     key = d and d[0].key or None
     return {"olid": i.olid, "key": key}
Ejemplo n.º 4
0
 def GET(self, sitename):
     i = server.input("key")
     author_id = get_thing_id(i.key)
     return (
         get_db()
         .query("SELECT count(*) as count FROM transaction WHERE author_id=$author_id", vars=locals())[0]
         .count
     )
Ejemplo n.º 5
0
 def GET(self, sitename):
     i = server.input("username")
     
     # Don't allows OLIDs to be usernames
     if web.re_compile(r"OL\d+[A-Z]").match(i.username.upper()):
         return True
     
     key = "/user/" + i.username.lower()
     type_user = get_thing_id("/type/user")
     d = get_db().query("SELECT * from thing WHERE lower(key) = $key AND type=$type_user", vars=locals())
     return bool(d)
Ejemplo n.º 6
0
 def GET(self, sitename):
     i = server.input("username")
     
     # Don't allows OLIDs to be usernames
     if web.re_compile(r"OL\d+[A-Z]").match(i.username.upper()):
         return True
     
     key = "/user/" + i.username.lower()
     type_user = get_thing_id("/type/user")
     d = get_db().query("SELECT * from thing WHERE lower(key) = $key AND type=$type_user", vars=locals())
     return bool(d)
Ejemplo n.º 7
0
 def GET(self, sitename):
     i = server.input("olid")
     d = get_db().query("SELECT key FROM thing WHERE get_olid(key) = $i.olid", vars=locals())
     key = d and d[0].key or None
     return {"olid": i.olid, "key": key}
Ejemplo n.º 8
0
 def GET(self, sitename):
     i = server.input('key')
     return count('edition_ref', '/type/edition', 'works', i.key)
Ejemplo n.º 9
0
 def GET(self, sitename):
     i = server.input('key')
     return count('edition_ref', '/type/edition', 'works', i.key)
Ejemplo n.º 10
0
 def GET(self, sitename):
     i = server.input("key")
     return count("edition_ref", "/type/edition", "works", i.key)