fixed django-tables rendering

This commit is contained in:
Kaibu
2019-11-13 23:44:52 +01:00
parent cead2fc45f
commit aca9501307
5 changed files with 122 additions and 113 deletions

View File

@@ -1,6 +1,7 @@
from django.contrib.auth.decorators import login_required
from django.db.models.functions import Lower
from django.shortcuts import render
from django.urls import reverse_lazy
from django_tables2 import RequestConfig
from django.utils.translation import gettext as _
@@ -13,7 +14,7 @@ def keyword(request):
table = KeywordTable(Keyword.objects.all())
RequestConfig(request, paginate={'per_page': 25}).configure(table)
return render(request, 'generic/list_template.html', {'title': _("Keyword"), 'table': table})
return render(request, 'generic/list_template.html', {'title': _("Keyword"), 'table': table, 'create_url': 'new_keyword'})
@login_required
@@ -27,6 +28,7 @@ def sync_log(request):
@login_required
def recipe_import(request):
table = RecipeImportTable(RecipeImport.objects.all())
RequestConfig(request, paginate={'per_page': 25}).configure(table)
return render(request, 'generic/list_template.html', {'title': _("Import"), 'table': table})
@@ -37,4 +39,4 @@ def storage(request):
table = StorageTable(Storage.objects.all())
RequestConfig(request, paginate={'per_page': 25}).configure(table)
return render(request, 'generic/list_template.html', {'title': _("Storage Backend"), 'table': table})
return render(request, 'generic/list_template.html', {'title': _("Storage Backend"), 'table': table, 'create_url': 'new_storage'})