Beispiel #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)
Beispiel #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}
Beispiel #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}
Beispiel #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
     )
Beispiel #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)
Beispiel #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)
Beispiel #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}
Beispiel #8
0
 def GET(self, sitename):
     i = server.input('key')
     return count('edition_ref', '/type/edition', 'works', i.key)
Beispiel #9
0
 def GET(self, sitename):
     i = server.input('key')
     return count('edition_ref', '/type/edition', 'works', i.key)
Beispiel #10
0
 def GET(self, sitename):
     i = server.input("key")
     return count("edition_ref", "/type/edition", "works", i.key)