mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 11:36:16 +00:00
Format with Black
This commit is contained in:
parent
d36699bd1f
commit
02d99a1671
5 changed files with 35 additions and 27 deletions
|
@ -30,8 +30,7 @@ def groups():
|
|||
|
||||
# Get the 3 most recent images
|
||||
images = (
|
||||
GroupJunction.query
|
||||
.with_entities(GroupJunction.post_id)
|
||||
GroupJunction.query.with_entities(GroupJunction.post_id)
|
||||
.filter(GroupJunction.group_id == group.id)
|
||||
.order_by(GroupJunction.date_added.desc())
|
||||
.limit(3)
|
||||
|
@ -41,8 +40,7 @@ def groups():
|
|||
group.images = []
|
||||
for image in images:
|
||||
group.images.append(
|
||||
Post.query
|
||||
.with_entities(Post.filename, Post.alt, Post.colours, Post.id)
|
||||
Post.query.with_entities(Post.filename, Post.alt, Post.colours, Post.id)
|
||||
.filter(Post.id == image[0])
|
||||
.first()
|
||||
)
|
||||
|
@ -60,8 +58,7 @@ def group(group_id):
|
|||
|
||||
# Get all images in the group from the junction table
|
||||
junction = (
|
||||
GroupJunction.query
|
||||
.with_entities(GroupJunction.post_id)
|
||||
GroupJunction.query.with_entities(GroupJunction.post_id)
|
||||
.filter(GroupJunction.group_id == group_id)
|
||||
.order_by(GroupJunction.date_added.desc())
|
||||
.all()
|
||||
|
|
|
@ -38,8 +38,9 @@ def index():
|
|||
|
||||
# get the images for the current page
|
||||
images = (
|
||||
Post.query
|
||||
.with_entities( Post.filename, Post.alt, Post.colours, Post.created_at, Post.id)
|
||||
Post.query.with_entities(
|
||||
Post.filename, Post.alt, Post.colours, Post.created_at, Post.id
|
||||
)
|
||||
.order_by(Post.id.desc())
|
||||
.offset((page - 1) * limit)
|
||||
.limit(limit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue