Added to search by the month in the search query in the accounting application.
This commit is contained in:
parent
c1446df532
commit
7f8375bfe7
@ -795,6 +795,13 @@ def search(request: HttpRequest) -> HttpResponse:
|
|||||||
| Q(transaction__date__year=date.year)
|
| Q(transaction__date__year=date.year)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
date = datetime.datetime.strptime(query, "%Y/%m")
|
||||||
|
conditions = conditions\
|
||||||
|
| (Q(transaction__date__year=date.year)
|
||||||
|
& Q(transaction__date__month=date.month))
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
date = datetime.datetime.strptime(query, "%m/%d")
|
date = datetime.datetime.strptime(query, "%m/%d")
|
||||||
conditions = conditions\
|
conditions = conditions\
|
||||||
|
Loading…
Reference in New Issue
Block a user