from django.shortcuts import render, redirect
from .models import *

# Create your views here.
def home(requests):
    context = {
        'posts':Post.objects.all()
    }
    return render(requests, "ad/home.html", context)

def todo(request):
    new = Post(content = request.POST['content'])
    new.save()
    return redirect('home')

def delete(request, pk):
    new = Post.objects.get(id=pk)
    new.delete()
    return redirect('home')

b3928b01844cf9e71ed5edcae62946d1cac840bd
<mask token>


def home(requests):
    context = {'posts': Post.objects.all()}
    return render(requests, 'ad/home.html', context)


<mask token>

<mask token>


def home(requests):
    context = {'posts': Post.objects.all()}
    return render(requests, 'ad/home.html', context)


def todo(request):
    new = Post(content=request.POST['content'])
    new.save()
    return redirect('home')


<mask token>

<mask token>


def home(requests):
    context = {'posts': Post.objects.all()}
    return render(requests, 'ad/home.html', context)


def todo(request):
    new = Post(content=request.POST['content'])
    new.save()
    return redirect('home')


def delete(request, pk):
    new = Post.objects.get(id=pk)
    new.delete()
    return redirect('home')

from django.shortcuts import render, redirect
from .models import *


def home(requests):
    context = {'posts': Post.objects.all()}
    return render(requests, 'ad/home.html', context)


def todo(request):
    new = Post(content=request.POST['content'])
    new.save()
    return redirect('home')


def delete(request, pk):
    new = Post.objects.get(id=pk)
    new.delete()
    return redirect('home')

from django.shortcuts import render, redirect
from .models import *

# Create your views here.
def home(requests):
    context = {
        'posts':Post.objects.all()
    }
    return render(requests, "ad/home.html", context)

def todo(request):
    new = Post(content = request.POST['content'])
    new.save()
    return redirect('home')

def delete(request, pk):
    new = Post.objects.get(id=pk)
    new.delete()
    return redirect('home')
