1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-27 02:43:01 +00:00

linter compliance

This commit is contained in:
Pierre-antoine Comby 2020-03-25 00:12:56 +01:00
parent 0411646ae6
commit f85f292d5b
3 changed files with 5 additions and 2 deletions

View File

@ -94,6 +94,7 @@ class TransactionTemplateViewSet(viewsets.ModelViewSet):
filterset_fields = ['name', 'amount', 'display', 'category', ] filterset_fields = ['name', 'amount', 'display', 'category', ]
search_fields = ['$name', ] search_fields = ['$name', ]
class TransactionViewSet(ReadProtectedModelViewSet): class TransactionViewSet(ReadProtectedModelViewSet):
""" """
REST API View set. REST API View set.

View File

@ -62,6 +62,7 @@ DELETE_TEMPLATE = """
<button id="{{ record.pk }}" class="btn btn-danger" onclick="delete_button(this.id)"> {{ delete_trans }}</button> <button id="{{ record.pk }}" class="btn btn-danger" onclick="delete_button(this.id)"> {{ delete_trans }}</button>
""" """
class AliasTable(tables.Table): class AliasTable(tables.Table):
class Meta: class Meta:
attrs = { attrs = {
@ -84,6 +85,7 @@ class AliasTable(tables.Table):
'a': {'class': 'btn btn-danger'}}, 'a': {'class': 'btn btn-danger'}},
text='delete', accessor='pk') text='delete', accessor='pk')
class ButtonTable(tables.Table): class ButtonTable(tables.Table):
class Meta: class Meta:
attrs = { attrs = {
@ -92,7 +94,7 @@ class ButtonTable(tables.Table):
} }
row_attrs = { row_attrs = {
'class': lambda record: 'table-row ' + 'table-success' if record.display else 'table-danger', '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 'data-href': lambda record: record.pk
} }

View File

@ -6,7 +6,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.db.models import Q from django.db.models import Q
from django.utils.translation import gettext_lazy as _ 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_tables2 import SingleTableView
from django.urls import reverse_lazy from django.urls import reverse_lazy
from permission.backends import PermissionBackend from permission.backends import PermissionBackend