17 lines
496 B
Python
Raw Normal View History

from typing import Text
from django.http import request
2020-11-09 11:57:23 +11:00
from django.shortcuts import redirect, render
2020-11-09 11:16:18 +11:00
from lists.models import Item
# Create your views here
def home_page(request):
return render(request=request, template_name='home.html')
2020-11-11 13:33:55 +11:00
def view_list(request):
items = Item.objects.all()
return render(request, 'list.html', {'items': items})
def new_list(request):
Item.objects.create(text=request.POST['item_text'])
return redirect('/lists/the-only-list-in-the-world/')