def get_user_id(username):
 rv = query_db('select user_id from user where username = ?', [username], one=True)
 return (rv[0] if rv else None)

def get_user_id ( username ) : rv = query_db ( 'select user_id from user where username = ?' , [ username ] , one = True ) return ( rv [ 0 ] if rv else None )
convenience method to look up the id for a username .