コード例 #1
0
ファイル: views.py プロジェクト: tonthon/etherpaddy
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))
コード例 #2
0
ファイル: views.py プロジェクト: tonthon/etherpaddy
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