Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8A4E3107EB for ; Fri, 23 Aug 2013 16:58:11 +0000 (UTC) Received: (qmail 23512 invoked by uid 500); 23 Aug 2013 16:58:08 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 23238 invoked by uid 500); 23 Aug 2013 16:58:04 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 22575 invoked by uid 99); 23 Aug 2013 16:58:02 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Aug 2013 16:58:02 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 73E8F8C3D08; Fri, 23 Aug 2013 16:58:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org Date: Fri, 23 Aug 2013 16:58:14 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [14/50] git commit: [#3154] ticket:395 created project __json__ [#3154] ticket:395 created 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/ef74610f Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ef74610f Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ef74610f Branch: refs/heads/cj/6530 Commit: ef74610fdc6828f721506073ee871e5a9ffadabd Parents: d79c80b Author: Anton Kasyanov Authored: Wed Jul 24 16:44:02 2013 +0300 Committer: Dave Brondsema Committed: Thu Aug 22 20:04:42 2013 +0000 ---------------------------------------------------------------------- Allura/allura/controllers/rest.py | 6 +----- Allura/allura/model/project.py | 7 +++++++ 2 files changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ef74610f/Allura/allura/controllers/rest.py ---------------------------------------------------------------------- diff --git a/Allura/allura/controllers/rest.py b/Allura/allura/controllers/rest.py index 6a41be3..d1b6cb1 100644 --- a/Allura/allura/controllers/rest.py +++ b/Allura/allura/controllers/rest.py @@ -281,8 +281,4 @@ class ProjectRestController(object): @expose('json:') def index(self, **kw): - return dict( - name=c.project.shortname, - tools=[dict(name=t.tool_name, mount_point=t.options.mount_point, label=t.options.mount_label) - for t in c.project.app_configs if h.has_access(t, 'read')] - ) + return c.project.__json__() http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ef74610f/Allura/allura/model/project.py ---------------------------------------------------------------------- diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py index 02fddac..1525eec 100644 --- a/Allura/allura/model/project.py +++ b/Allura/allura/model/project.py @@ -837,6 +837,13 @@ class Project(MappedClass, ActivityNode, ActivityObject): elif os.path.exists(tmpdir): return 'busy' + def __json__(self): + return dict( + name=self.shortname, + 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')] + ) + class AppConfig(MappedClass): """