Revised the order in the search query in the accounting application.
This commit is contained in:
parent
b92b7fb489
commit
c1446df532
@ -786,13 +786,13 @@ def search(request: HttpRequest) -> HttpResponse:
|
|||||||
| Q(transaction__pk=int(query))\
|
| Q(transaction__pk=int(query))\
|
||||||
| Q(account__pk=int(query))
|
| Q(account__pk=int(query))
|
||||||
try:
|
try:
|
||||||
date = datetime.datetime.strptime(query, "%Y")
|
conditions = conditions | Q(transaction__date=parse_date(query))
|
||||||
conditions = conditions\
|
|
||||||
| Q(transaction__date__year=date.year)
|
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
conditions = conditions | Q(transaction__date=parse_date(query))
|
date = datetime.datetime.strptime(query, "%Y")
|
||||||
|
conditions = conditions\
|
||||||
|
| Q(transaction__date__year=date.year)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user