Exemple #1
0
def genpadname(request):
    """
        Redirect to a new pad with a random name
    """
    all_pads = [p.get_name() for p in get_all_pads()]
    name = gen_random()
    while name in all_pads:
        name = gen_random()
    return HTTPFound(route_path('pad', request, padid=name))
Exemple #2
0
def pads(request):
    """
        Returns the list of all users
    """
    all_pads = get_all_pads()
    if request.is_xhr:
        return_datas = [jsonify(p) for p in all_pads]
    else:
        return_datas = {'title':"List of all our pads", "pads":all_pads}
    return return_datas