more robust home_page() FBV in apps.dashboard.views feat. individual item handling; .tests return OK given this new view

This commit is contained in:
Disco DeDisco
2025-12-31 00:47:17 -05:00
parent e3fdc54ad4
commit 1950eaa12e
2 changed files with 13 additions and 3 deletions

View File

@@ -1,9 +1,14 @@
from django.http import HttpResponse
from django.shortcuts import render
from .models import Item
def home_page(request):
item = Item()
item.text = request.POST.get('item_text', '')
item.save()
return render(
request,
'apps/dashboard/home.html',
{'new_item_text': request.POST.get('item-text', '')},
{'new_item_text': request.POST.get('item_text', '')},
)