Show More
@@ -169,10 +169,10 b' class PostManager(models.Manager):' | |||||
169 | day_end = today - timedelta(i + 1) |
|
169 | day_end = today - timedelta(i + 1) | |
170 | day_start = today - timedelta(i + 2) |
|
170 | day_start = today - timedelta(i + 2) | |
171 |
|
171 | |||
172 |
day_time_start = timezone.make_aware(datetime.combine( |
|
172 | day_time_start = timezone.make_aware(datetime.combine( | |
173 | dtime()), timezone.get_current_timezone()) |
|
173 | day_start, dtime()), timezone.get_current_timezone()) | |
174 |
day_time_end = timezone.make_aware(datetime.combine( |
|
174 | day_time_end = timezone.make_aware(datetime.combine( | |
175 | dtime()), timezone.get_current_timezone()) |
|
175 | day_end, dtime()), timezone.get_current_timezone()) | |
176 |
|
176 | |||
177 | posts_per_days.append(float(self.filter( |
|
177 | posts_per_days.append(float(self.filter( | |
178 | pub_time__lte=day_time_end, |
|
178 | pub_time__lte=day_time_end, | |
@@ -302,9 +302,8 b' class Post(models.Model):' | |||||
302 | if not link: |
|
302 | if not link: | |
303 | opening_post = self.thread_new.get_opening_post() |
|
303 | opening_post = self.thread_new.get_opening_post() | |
304 | if self != opening_post: |
|
304 | if self != opening_post: | |
305 | link = reverse('thread', |
|
305 | link = reverse('thread', kwargs={ | |
306 |
|
|
306 | 'post_id': opening_post.id}) + '#' + str(self.id) | |
307 | self.id) |
|
|||
308 | else: |
|
307 | else: | |
309 | link = reverse('thread', kwargs={'post_id': self.id}) |
|
308 | link = reverse('thread', kwargs={'post_id': self.id}) | |
310 |
|
309 | |||
@@ -379,8 +378,8 b' class Thread(models.Model):' | |||||
379 | if reply_count > 0: |
|
378 | if reply_count > 0: | |
380 | reply_count_to_show = min(settings.LAST_REPLIES_COUNT, |
|
379 | reply_count_to_show = min(settings.LAST_REPLIES_COUNT, | |
381 | reply_count - 1) |
|
380 | reply_count - 1) | |
382 |
last_replies = self.replies.all().order_by( |
|
381 | last_replies = self.replies.all().order_by( | |
383 |
|
|
382 | 'pub_time')[reply_count - reply_count_to_show:] | |
384 |
|
383 | |||
385 | return last_replies |
|
384 | return last_replies | |
386 |
|
385 |
General Comments 0
You need to be logged in to leave comments.
Login now