diff --git a/apps/note/api/views.py b/apps/note/api/views.py index 977441f7..d35c3797 100644 --- a/apps/note/api/views.py +++ b/apps/note/api/views.py @@ -5,6 +5,7 @@ from django.db.models import Q from django_filters.rest_framework import DjangoFilterBackend from rest_framework.filters import OrderingFilter, SearchFilter from api.viewsets import ReadProtectedModelViewSet, ReadOnlyProtectedModelViewSet +from rest_framework import viewsets from .serializers import NotePolymorphicSerializer, AliasSerializer, TemplateCategorySerializer, \ TransactionTemplateSerializer, TransactionPolymorphicSerializer @@ -81,7 +82,7 @@ class TemplateCategoryViewSet(ReadProtectedModelViewSet): search_fields = ['$name', ] -class TransactionTemplateViewSet(ReadProtectedModelViewSet): +class TransactionTemplateViewSet(viewsets.ModelViewSet): """ REST API View set. The djangorestframework plugin will get all `TransactionTemplate` objects, serialize it to JSON with the given serializer, diff --git a/apps/note/tables.py b/apps/note/tables.py index 2986c748..ad57c265 100644 --- a/apps/note/tables.py +++ b/apps/note/tables.py @@ -90,5 +90,10 @@ class ButtonTable(tables.Table): model = TransactionTemplate + + delete = tables.TemplateColumn(template_code=""" +