Include list of attachments in API results, not just a boolean
authorMagnus Hagander <magnus@hagander.net>
Sun, 18 Aug 2013 15:21:07 +0000 (17:21 +0200)
committerMagnus Hagander <magnus@hagander.net>
Sun, 18 Aug 2013 15:21:07 +0000 (17:21 +0200)
django/archives/mailarchives/api.py

index 4f31c608698849f034718e683090011ff0df1df0..9ef2193d50fa1f9e1f585b06cf2dc1d665fdcc97 100644 (file)
@@ -59,7 +59,8 @@ def thread(request, msgid):
                 'date': m.date.isoformat(),
                 'from': m.mailfrom,
                 'subj': m.subject,
-                'att': m.has_attachment}
+                'atts': [a.id for a in m.attachment_set.all()],
+        }
                for m in mlist], resp)
        resp['X-pgthread'] = m.threadid
        return resp