storage backend reworked

This commit is contained in:
vabene1111
2018-05-25 16:49:10 +02:00
parent c5986c6e7f
commit 4871b6194c
21 changed files with 278 additions and 128 deletions

View File

@@ -6,7 +6,7 @@ from django.urls import reverse_lazy
from django.utils.translation import gettext as _
from django.views.generic import CreateView
from cookbook.forms import ImportRecipeForm, RecipeImport, CategoryForm, KeywordForm
from cookbook.forms import ImportRecipeForm, RecipeImport, CategoryForm, KeywordForm, Storage, StorageForm
from cookbook.models import Category, Keyword, Recipe
@@ -46,6 +46,18 @@ class KeywordCreate(LoginRequiredMixin, CreateView):
return context
class StorageCreate(LoginRequiredMixin, CreateView):
template_name = "generic\\new_template.html"
model = Storage
form_class = StorageForm
success_url = reverse_lazy('list_storage')
def get_context_data(self, **kwargs):
context = super(StorageCreate, self).get_context_data(**kwargs)
context['title'] = _("Storage Backend")
return context
@login_required
def create_new_recipe(request, import_id):
if request.method == "POST":