Exemplo n.º 1
0
def add_bookmark_view(request):
    result = {'error': False}
    form = AddBookmarkForm(request, request.POST)

    if form.is_valid():
        bookmark = form.save()
        result['id'] = bookmark.pk
    else:
        result['error'] = True

    return JsonResponse(result)
Exemplo n.º 2
0
def add_bookmark_view(request):
    result = {"error": False}
    form = AddBookmarkForm(request, request.POST)

    if form.is_valid():
        bookmark = form.save()
        result["id"] = bookmark.pk
    else:
        result["error"] = True

    return JsonResponse(result)
Exemplo n.º 3
0
def add_bookmark_view(request):
    result = {'error': False}
    form = AddBookmarkForm(request, request.POST)

    if form.is_valid():
        bookmark = form.save()
        result.update({
            'id': bookmark.pk,
            'title': bookmark.title,
            'url': bookmark.url
        })
    else:
        result['error'] = True

    return JsonResponse(result)
Exemplo n.º 4
0
def add_bookmark_view(request):
    result = {"error": False}
    form = AddBookmarkForm(request, request.POST)

    if form.is_valid():
        bookmark = form.save()
        result.update({
            "id": bookmark.pk,
            "title": bookmark.title,
            "url": bookmark.url
        })
    else:
        result["error"] = True

    return JsonResponse(result)
Exemplo n.º 5
0
def add_bookmark_view(request):
    result = {'error': False}
    form = AddBookmarkForm(request, request.POST)

    if form.is_valid():
        bookmark = form.save()
        result.update({
            'id': bookmark.pk,
            'title': bookmark.title,
            'url': bookmark.url
        })
    else:
        result['error'] = True

    return JsonResponse(result)