add purchase date to game view
Django CI/CD / test (push) Successful in 1m9s Details
Django CI/CD / build-and-push (push) Successful in 2m8s Details

This commit is contained in:
Lukáš Kucharczyk 2024-09-11 11:40:17 +02:00
parent 7f6584ecf7
commit 698c8966c0
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 2 additions and 1 deletions

View File

@ -229,11 +229,12 @@ def view_game(request: HttpRequest, game_id: int) -> HttpResponse:
} }
purchase_data: dict[str, Any] = { purchase_data: dict[str, Any] = {
"columns": ["Name", "Type", "Price", "Actions"], "columns": ["Name", "Type", "Date", "Price", "Actions"],
"rows": [ "rows": [
[ [
purchase.name if purchase.name else purchase.edition.name, purchase.name if purchase.name else purchase.edition.name,
purchase.get_type_display(), purchase.get_type_display(),
purchase.date_purchased.strftime(dateformat),
f"{purchase.price} {purchase.price_currency}", f"{purchase.price} {purchase.price_currency}",
render_to_string( render_to_string(
"cotton/button_group.html", "cotton/button_group.html",