mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-10 00:28:22 -05:00
batch edit
This commit is contained in:
@@ -20,34 +20,6 @@ def index(request):
|
||||
return render(request, 'index.html')
|
||||
|
||||
|
||||
@login_required
|
||||
def batch_import(request):
|
||||
if request.method == "POST":
|
||||
form = ImportForm(request.POST)
|
||||
if form.is_valid():
|
||||
dropbox.import_all(form.cleaned_data['path'])
|
||||
return redirect('index')
|
||||
else:
|
||||
form = ImportForm()
|
||||
|
||||
return render(request, 'batch/import.html', {'form': form})
|
||||
|
||||
|
||||
@login_required
|
||||
def batch_category(request):
|
||||
if request.method == "POST":
|
||||
form = BatchCategoryForm(request.POST)
|
||||
if form.is_valid():
|
||||
word = form.cleaned_data['search']
|
||||
category = form.cleaned_data['category']
|
||||
Recipe.objects.filter(name__contains=word).update(category=(Category.objects.get(name=category)).id)
|
||||
return redirect('index')
|
||||
else:
|
||||
form = BatchCategoryForm()
|
||||
|
||||
return render(request, 'batch/category.html', {'form': form})
|
||||
|
||||
|
||||
@login_required
|
||||
def edit_recipe(request, recipe_id):
|
||||
if request.method == "POST":
|
||||
|
||||
Reference in New Issue
Block a user