def index(request):
note = Note.objects.filter(user=request.user.id)
return render(request, 'note/index.html',
{
'note' : note,
}
)
def index(request):
if request.GET['pub_date']:
items = Note.objects.order_by('-pub_date')
else:
items = Note.objects.all()
return render(...)