Пример #1
0
def pile_create(request):
    if request.method == "POST":
        create_pile_form = CreatePileForm(request.POST)
        if create_pile_form.is_valid():
            name = create_pile_form.cleaned_data["name"]
            pile = Pile(name=name, is_standalone=True)
            pile.save()
            if request.is_ajax():
                return utils.asyncAllPilesRefresh()
    return redirect("scraps_admin_manage")
Пример #2
0
def pile_delete(request, pile_id):
    utils.pile_delete(pile_id)
    if request.is_ajax():
        return utils.asyncAllPilesRefresh()
    return redirect("scraps_admin_manage")
Пример #3
0
def scrap_repile(request, scrap_id, pile_id=None):
    utils.scrap_repile(scrap_id, pile_id)
    if request.is_ajax():
        return utils.asyncAllPilesRefresh()
    return redirect("scraps_admin_manage")