From 70d725d2afb0ef7c2f94ca12c0166d2ff47e20f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Fri, 4 Sep 2020 19:36:32 +0800 Subject: [PATCH] Added the account primary key to the search query in the accounting application. --- accounting/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accounting/views.py b/accounting/views.py index 9d6139d..96c96d1 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -783,7 +783,8 @@ def search(request: HttpRequest) -> HttpResponse: if re.match("^[0-9]{9}$", query): conditions = conditions\ | Q(pk=int(query))\ - | Q(transaction__pk=int(query)) + | Q(transaction__pk=int(query))\ + | Q(account__pk=int(query)) if re.match("^[0-9]{4}$", query): conditions = conditions\ | Q(transaction__date__year=int(query))