From 184e94e2c61f72465f24b9ac20c5fc276cae16a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Wed, 5 Aug 2020 13:35:09 +0800 Subject: [PATCH] Revised the codes in the views with PEP8 and PyCharms inspection for the accounting application. --- accounting/views.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/accounting/views.py b/accounting/views.py index 4dcc45f..4723f39 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -888,8 +888,9 @@ def txn_store(request, txn_type, txn=None): txn_to_sort = [] if txn.date != old_date: if old_date is not None: - txn_same_day = list(Transaction.objects\ - .filter(Q(date=old_date), ~Q(pk=txn.pk))\ + txn_same_day = list( + Transaction.objects + .filter(Q(date=old_date), ~Q(pk=txn.pk)) .order_by("ord")) for i in range(len(txn_same_day)): txn_same_day[i].ord = i + 1 @@ -937,8 +938,9 @@ def txn_delete(request, txn): Returns: HttpResponse: The response. """ - txn_same_day = list(Transaction.objects\ - .filter(Q(date=txn.date), ~Q(pk=txn.pk))\ + txn_same_day = list( + Transaction.objects + .filter(Q(date=txn.date), ~Q(pk=txn.pk)) .order_by("ord")) txn_to_sort = [] for i in range(len(txn_same_day)):