You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
418 B
Python
19 lines
418 B
Python
from django.shortcuts import render
|
|
from .models import Entry
|
|
from .forms import EntryForm
|
|
|
|
|
|
def index(request):
|
|
# entries = Entry.objects.all()
|
|
entries = Entry.objects.order_by('-date')
|
|
|
|
context = {'entries': entries}
|
|
return render(request, 'entries/index.html', context)
|
|
|
|
|
|
def add(request):
|
|
form = EntryForm()
|
|
|
|
context = {'form': form}
|
|
return render(request, 'entries/add.html', context)
|