diff options
author | Dan McGee <dan@archlinux.org> | 2011-06-14 19:10:16 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-06-14 19:10:16 -0500 |
commit | dc9dedaeb075630fa284036fb2f39de3c69004f9 (patch) | |
tree | 3f209e683dd4d7e548bc21e97af47527857fb414 /mirrors | |
parent | 037f67bb3c0b63239614ece9884b33c2d265b8ae (diff) |
Add JSON package details and files views
These are retrieved by adding 'json/' to the normal package details or
files view.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors')
-rw-r--r-- | mirrors/views.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mirrors/views.py b/mirrors/views.py index f03a2e8a..6135cee3 100644 --- a/mirrors/views.py +++ b/mirrors/views.py @@ -155,9 +155,8 @@ class MirrorStatusJSONEncoder(DjangoJSONEncoder): # mainly for queryset serialization return list(obj) if isinstance(obj, MirrorUrl): - data = {} - for attr in self.url_attributes: - data[attr] = getattr(obj, attr) + data = dict((attr, getattr(obj, attr)) + for attr in self.url_attributes) # separate because it isn't on the URL directly data['country'] = obj.real_country return data |