def sample_get_file_url(filename): user = api.current_user() if user: oid = api.oid_by_name(user, filename) if oid: return api.url_for(user, oid) return ''
def get_id_by_filename(key, filename): user = api.user_by_key(key) if not user: abort(404) oid = api.oid_by_name(user, filename) if oid: return oid abort(404)