Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: app/handlers/packages.py

Issue 808253003: Use uploaderEmails instead of uploaders (Closed) Base URL: https://github.com/dart-lang/pub-dartlang.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | app/models/package.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 # for details. All rights reserved. Use of this source code is governed by a 2 # for details. All rights reserved. Use of this source code is governed by a
3 # BSD-style license that can be found in the LICENSE file. 3 # BSD-style license that can be found in the LICENSE file.
4 4
5 import json 5 import json
6 6
7 import cherrypy 7 import cherrypy
8 from google.appengine.api import users 8 from google.appengine.api import users
9 9
10 import handlers 10 import handlers
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 layout={'title': title}) 49 layout={'title': title})
50 50
51 @handlers.json_or_html_action 51 @handlers.json_or_html_action
52 def show(self, id, format='html'): 52 def show(self, id, format='html'):
53 """Retrieve the page describing a specific package.""" 53 """Retrieve the page describing a specific package."""
54 if format == 'json': 54 if format == 'json':
55 package = handlers.request().package 55 package = handlers.request().package
56 versions = [str(version.version) for version in package.version_set] 56 versions = [str(version.version) for version in package.version_set]
57 return json.dumps({ 57 return json.dumps({
58 "name": package.name, 58 "name": package.name,
59 "uploaders": [uploader.email() for uploader 59 "uploaders": package.uploaderEmails,
60 in package.uploaders],
61 "versions": versions 60 "versions": versions
62 }) 61 })
63 elif format == 'html': 62 elif format == 'html':
64 package = handlers.request().package 63 package = handlers.request().package
65 version_count = package.version_set.count() 64 version_count = package.version_set.count()
66 65
67 title = package.name 66 title = package.name
68 readme = None 67 readme = None
69 readme_filename = None 68 readme_filename = None
70 changelog = None 69 changelog = None
(...skipping 16 matching lines...) Expand all
87 versions=package.version_set.order('-sort_order').fetch(10), 86 versions=package.version_set.order('-sort_order').fetch(10),
88 version_count=version_count, 87 version_count=version_count,
89 show_versions_link=version_count > 10, 88 show_versions_link=version_count > 10,
90 readme=readme, 89 readme=readme,
91 readme_filename=readme_filename, 90 readme_filename=readme_filename,
92 changelog=changelog, 91 changelog=changelog,
93 changelog_filename=changelog_filename, 92 changelog_filename=changelog_filename,
94 layout={'title': title}) 93 layout={'title': title})
95 else: 94 else:
96 raise handlers.http_error(404) 95 raise handlers.http_error(404)
OLDNEW
« no previous file with comments | « no previous file | app/models/package.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698