incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [19/50] git commit: [#3153] ticket:389 added saved search bins to tracker bulk_export
Date Thu, 22 Aug 2013 21:53:45 GMT
[#3153] ticket:389 added saved search bins to tracker bulk_export


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/2a60f9a6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2a60f9a6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2a60f9a6

Branch: refs/heads/master
Commit: 2a60f9a6bf868e940ba8da4ff76a231a1bc320cc
Parents: 59d60f6
Author: Anton Kasyanov <mind1master@gmail.com>
Authored: Tue Jul 23 20:46:36 2013 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Aug 22 20:04:42 2013 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/model/ticket.py   | 8 ++++++++
 ForgeTracker/forgetracker/tests/test_app.py | 3 +++
 ForgeTracker/forgetracker/tracker_main.py   | 3 +++
 3 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2a60f9a6/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 80ce102..0536f71 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -512,6 +512,14 @@ class Bin(Artifact, ActivityObject):
             terms_s=self.terms)
         return result
 
+    def __json__(self):
+        return dict(super(Bin,self).__json__(),
+            _id=self._id,
+            summary=self.summary,
+            terms=self.terms,
+            sort=self.sort,
+        )
+
 class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
     class __mongometa__:
         name = 'ticket'

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2a60f9a6/ForgeTracker/forgetracker/tests/test_app.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/test_app.py b/ForgeTracker/forgetracker/tests/test_app.py
index a718885..c84fa8d 100644
--- a/ForgeTracker/forgetracker/tests/test_app.py
+++ b/ForgeTracker/forgetracker/tests/test_app.py
@@ -63,3 +63,6 @@ class TestBulkExport(TrackerTestController):
         milestones = sorted(tracker['milestones'], key=operator.itemgetter('name'))
         assert_equal(milestones[0]['name'], '1.0')
         assert_equal(milestones[1]['name'], '2.0')
+
+        saved_bins_summaries = [bin['summary'] for bin in tracker['saved_bins']]
+        assert_true('Closed Tickets' in saved_bins_summaries)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2a60f9a6/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 1880cd8..a0740a9 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -423,6 +423,9 @@ class ForgeTrackerApp(Application):
         f.write(', "milestones":')
         milestones = self.milestones
         json.dump(milestones, f, cls=jsonify.GenericJSON)
+        f.write(', "saved_bins":')
+        bins = self.bins        
+        json.dump(bins, f, cls=jsonify.GenericJSON)
         f.write('}')
 
     @property


Mime
View raw message