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