Skip to content

Commit

Permalink
Condense limited_roots into list comprehension for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
sjuxax committed Dec 15, 2011
1 parent ec0cf0d commit 65dced6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions raggregate/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,10 @@ def get_comments_by_story_id(id, organize_parentage = False, page_num = 1, per_p
roots = roots.order_by(Comment.added_on.desc())

endpoints = get_endpoints_from_page_num(page_num, per_page)
limited_roots = roots[endpoints['start']:endpoints['end']]

allowed_roots = [ ]

for root in limited_roots:
allowed_roots.append(str(root.id))
[allowed_roots.append(str(root.id)) for root in roots[endpoints['start']:endpoints['end']]]

structures = _build_comment_structures(all_comments, allowed_roots, tree, {})
tree = structures['tree']
Expand Down

0 comments on commit 65dced6

Please sign in to comment.