You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/08/21 22:12:34 UTC

[18/50] git commit: [#3154] ticket:395 added more info to project json

[#3154] ticket:395 added more info to project json


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

Branch: refs/heads/db/3154b
Commit: ba3de6a343000e2e6a135c23ce4628aed2949952
Parents: e4b340a
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Wed Jul 24 17:21:11 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Aug 21 18:12:25 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/auth.py    | 7 +++++++
 Allura/allura/model/project.py | 8 ++++++++
 2 files changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ba3de6a3/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index da0b164..c8964f3 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -698,6 +698,13 @@ class User(MappedClass, ActivityNode, ActivityObject):
     def withskill(cls, skill):
         return cls.query.find({"skills.category_id" : skill._id})
 
+    def __json__(self):
+        return dict(
+            username=self.username,
+            name=self.display_name,
+            url=self.url(),
+        )
+
 class OldProjectRole(MappedClass):
     class __mongometa__:
         session = project_orm_session

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ba3de6a3/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 1525eec..941b360 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -840,6 +840,14 @@ class Project(MappedClass, ActivityNode, ActivityObject):
     def __json__(self):
         return dict(
             name=self.shortname,
+            title=self.name,
+            _id=self._id,
+            private=self.private,
+            short_description=self.short_description,
+            description=self.description,
+            download_page=self.best_download_url(),
+            preferred_support=self.support_page_url,
+            developers=self.users_with_role('Developer'),
             tools=[dict(name=t.tool_name, mount_point=t.options.mount_point, label=t.options.mount_label)
                    for t in self.app_configs if h.has_access(t, 'read')]
         )