Skip to content

Commit

Permalink
日付順でソートするようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
crashRT committed Aug 17, 2022
1 parent 9eaeb92 commit 3568f35
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion notes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def noteslistview(request):


def notestagview(requested, tagname):
notes_list = NotesModel.objects.filter(tag__in=[tagname]).distinct()
notes_list = NotesModel.objects.filter(
tag__in=[tagname]).distinct().order_by('date').reverse()
context = {
'notes_list': notes_list,
'taglist': tags,
Expand Down
5 changes: 3 additions & 2 deletions projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def projectslistview(request):
projects_list = ProjectsModel.objects.all()
projects_list = ProjectsModel.objects.order_by('date').reverse()
context = {
'projects_list': projects_list,
'taglist': tags
Expand All @@ -19,7 +19,8 @@ def projectsdetailview(request, pk):


def projectstagview(requested, tagname):
projects_list = ProjectsModel.objects.filter(tag__in=[tagname]).distinct()
projects_list = ProjectsModel.objects.filter(
tag__in=[tagname]).distinct().order_by('date').reverse()
context = {
'projects_list': projects_list,
'taglist': tags,
Expand Down
5 changes: 3 additions & 2 deletions works/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def worklistview(request):
work_list = WorksModel.objects.all()
work_list = WorksModel.objects.order_by('date').reverse()
context = {
'works_list': work_list,
'taglist': tags,
Expand All @@ -20,7 +20,8 @@ def workdetailview(request, pk):


def workstagview(requested, tagname):
work_list = WorksModel.objects.filter(tag__in=[tagname]).distinct()
work_list = WorksModel.objects.filter(
tag__in=[tagname]).distinct().order_by('date').reverse()
context = {
'works_list': work_list,
'taglist': tags,
Expand Down

0 comments on commit 3568f35

Please sign in to comment.