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 17:27:09 UTC

[27/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/a63d2b46
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/a63d2b46
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/a63d2b46

Branch: refs/heads/db/3154b
Commit: a63d2b461fb99d1f11e99664caf8915f347f3d28
Parents: 546bfcc
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 15:25:57 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/a63d2b46/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/a63d2b46/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')]
         )