more generic views

This commit is contained in:
vabene1111
2018-05-02 22:28:02 +02:00
parent b3a45d8069
commit 399f581d86
7 changed files with 70 additions and 13 deletions

View File

@ -13,6 +13,7 @@ class RecipeTable(tables.Table):
attrs={'td': {'class': 'd-none d-lg-table-cell'}, 'th': {'class': 'd-none d-lg-table-cell'}})
all_tags = tables.Column(
attrs={'td': {'class': 'd-none d-lg-table-cell'}, 'th': {'class': 'd-none d-lg-table-cell'}})
delete = tables.TemplateColumn("<a href='{% url 'delete_recipe' record.id %}' >" + _('Delete') + "</a>") # TODO remove and put into edit page
class Meta:
model = Recipe
@ -22,6 +23,7 @@ class RecipeTable(tables.Table):
class CategoryTable(tables.Table):
id = tables.LinkColumn('edit_category', args=[A('id')])
delete = tables.TemplateColumn("<a href='{% url 'delete_category' record.id %}' >" + _('Delete') + "</a>")
class Meta:
model = Category
@ -31,6 +33,7 @@ class CategoryTable(tables.Table):
class KeywordTable(tables.Table):
id = tables.LinkColumn('edit_keyword', args=[A('id')])
delete = tables.TemplateColumn("<a href='{% url 'delete_keyword' record.id %}' >" + _('Delete') + "</a>")
class Meta:
model = Keyword