From dc9dedaeb075630fa284036fb2f39de3c69004f9 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 14 Jun 2011 19:10:16 -0500 Subject: 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 --- mirrors/views.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mirrors') diff --git a/mirrors/views.py b/mirrors/views.py index f03a2e8..6135cee 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 -- cgit v1.2.3-24-g4f1b