Fiks opslags rækkefølge og dato format
This commit is contained in:
@ -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 []
|
||||
|
@ -10,7 +10,7 @@
|
||||
<div class="media-body">
|
||||
<div class="article-metadata">
|
||||
<a class="mr-2 author-name" href="#">{{ post.author.first_name }} {{ post.author.last_name }} </a>
|
||||
<small class="text-muted float-right">{{ post.created_date.strftime('%H:%I %d-%m-%Y')}}</small>
|
||||
<small class="text-muted float-right">{{ post.created_date.strftime('%H:%M %d-%m-%Y')}}</small>
|
||||
</div>
|
||||
<h2><a class="article-title" href="#">{{ post.title }}</a></h2>
|
||||
<p class="article-content">{{ post.content }}</p>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<div class="media-body">
|
||||
<div class="article-metadata">
|
||||
<a class="mr-2 author-name" href="#">{{ post.author.first_name }} {{ post.author.last_name }}</a>
|
||||
<small class="text-muted float-right">{{ post.created_date.strftime('%H:%I %d-%m-%Y')}}</small>
|
||||
<small class="text-muted float-right">{{ post.created_date.strftime('%H:%M %d-%m-%Y')}}</small>
|
||||
</div>
|
||||
<h2><a class="article-title" href="#">{{ post.title }}</a></h2>
|
||||
<p class="article-content">{{ post.content }}</p>
|
||||
|
Reference in New Issue
Block a user