incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [13/50] git commit: [#3154] ticket:395 added more info to project json
Date Fri, 23 Aug 2013 16:58:13 GMT
[#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/ca4437ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ca4437ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ca4437ad

Branch: refs/heads/cj/6530
Commit: ca4437addd2120991ba68fd2b64ce15db6c3a7e8
Parents: ef74610
Author: Anton Kasyanov <mind1master@gmail.com>
Authored: Wed Jul 24 17:21:11 2013 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Thu Aug 22 20:04:42 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/ca4437ad/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/ca4437ad/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')]
         )


Mime
View raw message