Exemplo n.º 1
0
def import_all(request):
    # if already delicious account...
    d = DeliciousSyncr(request.user.delicious_account.get().username,request.user.delicious_account.get().password)
    print "inicio sincronizacion"
    d.syncAll(request.user)
    print "fin sincronizacion"
#            return HttpResponseRedirect(reverse("syncr_pinax.delicious.views.recently_imported")
    return HttpResponseRedirect(reverse("bookmarks.views.your_bookmarks"))
Exemplo n.º 2
0
def add_delicious_account(request):
    # if already delicious account...
    
    if request.method == "POST":
        delicious_account_form = DeliciousAccountForm(request.user, request.POST)
        if delicious_account_form.is_valid():
            delicious_account = delicious_account_form.save(commit=False)
            delicious_account.user = request.user
            delicious_account.save()
            
            d = DeliciousSyncr(delicious_account.username, delicious_account.password)
            d.syncAll(request.user)
#            return HttpResponseRedirect(reverse("syncr_pinax.delicious.views.recently_imported"))
            return HttpResponseRedirect(reverse("bookmarks.views.your_bookmarks"))
    else:
        delicious_account_form = DeliciousAccountForm()
    
    return render_to_response("delicious/add_delicious_account.html", {
        "delicious_account_form": delicious_account_form,
    }, context_instance=RequestContext(request))