You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
414 B

from django.shortcuts import render
from .models import Contact
# Create your views here.
## index
def contact_list(request):
contacts = Contact.objects.all()
return render(request, 'contacts/contact_list.html', { 'contacts': contacts})
## show
def contact_detail(request, pk):
contact = Contact.objects.get(id=pk)
return render(request, 'contacts/contact_detail.html', {'contact': contact})