forked from MarseyWorld/MarseyWorld
messing with relationships
parent
367348c8b2
commit
91951ed142
|
@ -147,9 +147,8 @@ def get_post(i, v=None, graceful=False, rendered=False):
|
|||
posts = post.options(
|
||||
joinedload(Submission.flags),
|
||||
joinedload(Submission.awards),
|
||||
joinedload(Submission.author),
|
||||
joinedload(Submission.options),
|
||||
joinedload(Submission.options, SubmissionOption.votes)
|
||||
joinedload(Submission.author).joinedload(User.badges),
|
||||
joinedload(Submission.options).joinedload(SubmissionOption.votes)
|
||||
)
|
||||
|
||||
post=post.one_or_none()
|
||||
|
@ -204,9 +203,8 @@ def get_posts(pids, v=None):
|
|||
isouter=True
|
||||
).options(joinedload(Submission.flags),
|
||||
joinedload(Submission.awards),
|
||||
joinedload(Submission.author),
|
||||
joinedload(Submission.options),
|
||||
joinedload(Submission.options, SubmissionOption.votes)
|
||||
joinedload(Submission.author).joinedload(User.badges),
|
||||
joinedload(Submission.options).joinedload(SubmissionOption.votes)
|
||||
).all()
|
||||
|
||||
output = [p[0] for p in query]
|
||||
|
|
|
@ -171,12 +171,11 @@ def post_id(pid, anything=None, v=None, sub=None):
|
|||
blocked.c.user_id == Comment.author_id,
|
||||
isouter=True
|
||||
).options(
|
||||
joinedload(Comment.child_comments),
|
||||
joinedload(Comment.flags),
|
||||
joinedload(Comment.awards),
|
||||
joinedload(Comment.author),
|
||||
joinedload(Comment.options),
|
||||
joinedload(Comment.options, CommentOption.votes),
|
||||
joinedload(Comment.child_comments)
|
||||
joinedload(Comment.author).joinedload(User.badges),
|
||||
joinedload(Comment.options).joinedload(CommentOption.votes)
|
||||
)
|
||||
|
||||
output = []
|
||||
|
|
Loading…
Reference in New Issue