Major redesign #73
.envrc.gitignore.pre-commit-config.yaml
.vscode
CHANGELOG.mdcommon
games
deviceviews.pyeditionviews.pyforms.pygameviews.py
manage.pypoetry.lockpyproject.tomlshell.nixmigrations
models.pyplatformviews.pypurchaseviews.pysessionviews.pystatic
templates
add_purchase.htmlbase.htmlcomponents.yml
components
button_group_button_sm.htmlbutton_group_sm.htmlgame_link.htmlpopover.htmlsimple_table.htmltable.htmltable_row.htmltable_td.html
list_purchases.htmllist_sessions.htmlnavbar.htmlregistration
stats.htmlview_game.htmltemplatetags
urls.pyviews.pytimetracker
@ -7,7 +7,6 @@ from django.shortcuts import get_object_or_404, redirect, render
|
|||||||
from django.template.loader import render_to_string
|
from django.template.loader import render_to_string
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from games.forms import PlatformForm
|
|
||||||
from games.models import Platform
|
from games.models import Platform
|
||||||
from games.views import dateformat
|
from games.views import dateformat
|
||||||
|
|
||||||
@ -74,3 +73,8 @@ def list_platforms(request: HttpRequest) -> HttpResponse:
|
|||||||
return render(request, "list_purchases.html", context)
|
return render(request, "list_purchases.html", context)
|
||||||
|
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
def delete_platform(request: HttpRequest, platform_id: int) -> HttpResponse:
|
||||||
|
platform = get_object_or_404(Platform, id=platform_id)
|
||||||
|
platform.delete()
|
||||||
|
return redirect("list_platforms")
|
||||||
|
Reference in New Issue
Block a user