From 5ecfe3b8367960c072bc99916d8d5d0e8f9b9752 Mon Sep 17 00:00:00 2001 From: Mikkel <4072916+Mikk3@users.noreply.github.com> Date: Tue, 31 May 2022 16:44:25 +0200 Subject: [PATCH] =?UTF-8?q?Fiks=20opslags=20r=C3=A6kkef=C3=B8lge=20og=20da?= =?UTF-8?q?to=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aula/models.py | 2 ++ aula/templates/group_show.html | 2 +- aula/templates/home.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/aula/models.py b/aula/models.py index ee14ce1..631b5f0 100644 --- a/aula/models.py +++ b/aula/models.py @@ -33,6 +33,7 @@ class Group(tuple): sql_call = """ SELECT * FROM posts WHERE group_id = %s + ORDER BY created_date DESC """ cur.execute(sql_call, (self.group_id,)) Posts = cur.fetchall() @@ -293,6 +294,7 @@ def get_posts_for_user(user_id): SELECT group_id FROM users_groups WHERE user_id = %s ) + ORDER BY created_date DESC """ cur.execute(sql_call, (user_id,)) user = [Post(i) for i in cur.fetchmany(50)] if cur.rowcount > 0 else [] diff --git a/aula/templates/group_show.html b/aula/templates/group_show.html index 2ea7ac8..1878c05 100644 --- a/aula/templates/group_show.html +++ b/aula/templates/group_show.html @@ -10,7 +10,7 @@
{{ post.author.first_name }} {{ post.author.last_name }} - {{ post.created_date.strftime('%H:%I %d-%m-%Y')}} + {{ post.created_date.strftime('%H:%M %d-%m-%Y')}}

{{ post.title }}

{{ post.content }}

diff --git a/aula/templates/home.html b/aula/templates/home.html index 1e681d6..5ac1a68 100644 --- a/aula/templates/home.html +++ b/aula/templates/home.html @@ -9,7 +9,7 @@

{{ post.title }}

{{ post.content }}