changeset 467:71988ea0f53e

minor edition in grouping of results, now changes done on the same day for a item is only shown in that item group
author Akash Sinha <akash2607@gmail.com>
date Tue, 14 Jun 2011 17:27:42 +0530
parents 7754844a1dbe
children 511a2a2e9950
files MoinMoin/apps/frontend/views.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Mon Jun 13 02:12:21 2011 +0530
+++ b/MoinMoin/apps/frontend/views.py	Tue Jun 14 17:27:42 2011 +0530
@@ -558,7 +558,11 @@
         if bookmark_time and rev.timestamp <= bookmark_time:
             break
         elif current_item_name in item_groups:
-            item_groups[current_item_name].append(rev)
+            latest_rev = item_groups[current_item_name][0]
+            tm_latest = datetime.utcfromtimestamp(latest_rev.timestamp)
+            tm_current = datetime.utcfromtimestamp(rev.timestamp)
+            if format_date(tm_latest) == format_date(tm_current): # this change took place on the same day
+                item_groups[current_item_name].append(rev)
         else:
             item_groups[current_item_name] = [rev]