mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-05 06:08:46 -05:00
Revert "added new keyword management page"
This reverts commit 6962b0e218.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import django_tables2 as tables
|
||||
from django.db.models.functions import Lower
|
||||
from django.utils.html import format_html
|
||||
from django.utils.translation import gettext as _
|
||||
from django_tables2.utils import A
|
||||
@@ -62,28 +61,6 @@ class KeywordTable(tables.Table):
|
||||
fields = ('id', 'icon', 'name')
|
||||
|
||||
|
||||
class ManageKeywordTable(tables.Table):
|
||||
name = tables.LinkColumn('edit_keyword', args=[
|
||||
A('id')])
|
||||
|
||||
class Meta:
|
||||
model = Keyword
|
||||
template_name = 'manage/keyword_table.html'
|
||||
fields = ('id', 'name')
|
||||
|
||||
def render_name(self, value, record):
|
||||
if record.icon != None:
|
||||
return format_html("{} {}", record.icon, value)
|
||||
else:
|
||||
return value
|
||||
|
||||
def order_name(self, queryset, is_descending):
|
||||
queryset = queryset.annotate(
|
||||
name_lower=Lower('name')
|
||||
).order_by(("-" if is_descending else "") + "name_lower")
|
||||
return (queryset, True)
|
||||
|
||||
|
||||
class IngredientTable(tables.Table):
|
||||
id = tables.LinkColumn('edit_food', args=[A('id')])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user