class filter tag

This commit is contained in:
vabene1111
2018-05-07 00:38:37 +02:00
parent 9b2d2bea4d
commit 8107e46b60
12 changed files with 32 additions and 31 deletions

View File

@@ -5,7 +5,7 @@ from django_tables2 import RequestConfig
from django.utils.translation import gettext as _
from cookbook.models import Category, Keyword, SyncLog, RecipeImport
from cookbook.tables import CategoryTable, KeywordTable, ImportLogTable, ImportTable
from cookbook.tables import CategoryTable, KeywordTable, ImportLogTable, RecipeImportTable
@login_required
@@ -25,7 +25,7 @@ def keyword(request):
@login_required
def import_log(request):
def sync_log(request):
table = ImportLogTable(SyncLog.objects.all().order_by(Lower('created_at').desc()))
RequestConfig(request, paginate={'per_page': 25}).configure(table)
@@ -33,8 +33,8 @@ def import_log(request):
@login_required
def new_recipe(request):
table = ImportTable(RecipeImport.objects.all())
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})