edit + tables

This commit is contained in:
Unknown
2018-02-01 15:34:43 +01:00
parent 4d3e8e6b53
commit e9dc2dc48f
8 changed files with 154 additions and 136 deletions

View File

@ -1,10 +1,31 @@
import django_tables2 as tables
from django_tables2.utils import A # alias for Accessor
from .models import *
class RecipeTable(tables.Table):
id = tables.LinkColumn('edit_recipe', args=[A('id')])
class Meta:
model = Recipe
template_name = 'tables/table_template.html'
fields = ('name', 'category', 'all_tags')
fields = ('id', 'name', 'category', 'all_tags')
class CategoryTable(tables.Table):
id = tables.LinkColumn('edit_recipe', args=[A('id')])
class Meta:
model = Category
template_name = 'tables/table_template.html'
fields = ('id', 'name')
class KeywordTable(tables.Table):
id = tables.LinkColumn('edit_recipe', args=[A('id')])
class Meta:
model = Keyword
template_name = 'tables/table_template.html'
fields = ('id', 'name')