diff --git a/apps/note/api/views.py b/apps/note/api/views.py index d35c3797..fc4a0e8f 100644 --- a/apps/note/api/views.py +++ b/apps/note/api/views.py @@ -94,6 +94,7 @@ class TransactionTemplateViewSet(viewsets.ModelViewSet): filterset_fields = ['name', 'amount', 'display', 'category', ] search_fields = ['$name', ] + class TransactionViewSet(ReadProtectedModelViewSet): """ REST API View set. diff --git a/apps/note/tables.py b/apps/note/tables.py index 6e662107..20054d2c 100644 --- a/apps/note/tables.py +++ b/apps/note/tables.py @@ -62,6 +62,7 @@ DELETE_TEMPLATE = """ """ + class AliasTable(tables.Table): class Meta: attrs = { @@ -84,6 +85,7 @@ class AliasTable(tables.Table): 'a': {'class': 'btn btn-danger'}}, text='delete', accessor='pk') + class ButtonTable(tables.Table): class Meta: attrs = { @@ -92,7 +94,7 @@ class ButtonTable(tables.Table): } row_attrs = { 'class': lambda record: 'table-row ' + 'table-success' if record.display else 'table-danger', - 'id': lambda record: "row-"+str(record.pk), + 'id': lambda record: "row-" + str(record.pk), 'data-href': lambda record: record.pk } diff --git a/apps/note/views.py b/apps/note/views.py index 7d8d80aa..ddf5ee6f 100644 --- a/apps/note/views.py +++ b/apps/note/views.py @@ -6,7 +6,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.contenttypes.models import ContentType from django.db.models import Q from django.utils.translation import gettext_lazy as _ -from django.views.generic import CreateView, ListView, UpdateView +from django.views.generic import CreateView, UpdateView from django_tables2 import SingleTableView from django.urls import reverse_lazy from permission.backends import PermissionBackend