Show More
@@ -63,16 +63,16 b' class PostManager(models.Manager):' | |||
|
63 | 63 | for post in posts: |
|
64 | 64 | self.delete_post(post) |
|
65 | 65 | |
|
66 |
def get_threads(self, tag=None, page=ALL_PAGES |
|
|
66 | def get_threads(self, tag=None, page=ALL_PAGES, | |
|
67 | order_by='-last_edit_time'): | |
|
67 | 68 | if tag: |
|
68 | 69 | threads = self.filter(parent=NO_PARENT, tags=tag) |
|
70 | ||
|
71 | # TODO Throw error 404 if no threads for tag found? | |
|
69 | 72 | else: |
|
70 | 73 | threads = self.filter(parent=NO_PARENT) |
|
71 | 74 | |
|
72 | if not threads: | |
|
73 | raise Http404 | |
|
74 | ||
|
75 | threads = threads.order_by('-last_edit_time') | |
|
75 | threads = threads.order_by(order_by) | |
|
76 | 76 | |
|
77 | 77 | if page != ALL_PAGES: |
|
78 | 78 | thread_count = len(threads) |
General Comments 0
You need to be logged in to leave comments.
Login now