Switch to unified view

a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
...
...
62
        return dict(
62
        return dict(
63
            _id=str(self._id),
63
            _id=str(self._id),
64
            shortname=self.shortname,
64
            shortname=self.shortname,
65
            name=self.name,
65
            name=self.name,
66
            description=self.description,
66
            description=self.description,
67
            threads=[dict(_id=t._id, subject=t.subject)
67
            threads=[t.__json__() for t in self.thread_class().query.find(
68
                     for t in self.threads])
68
                dict(discussion_id=self._id)).sort(
69
                    'last_post_date', pymongo.DESCENDING)])
69
70
70
    @property
71
    @property
71
    def activity_name(self):
72
    def activity_name(self):
72
        return 'discussion %s' % self.name
73
        return 'discussion %s' % self.name
73
74
...
...
167
            posts=[dict(slug=p.slug,
168
            posts=[dict(slug=p.slug,
168
                        text=p.text,
169
                        text=p.text,
169
                        subject=p.subject,
170
                        subject=p.subject,
170
                        attachments=[dict(bytes=attach.length,
171
                        attachments=[dict(bytes=attach.length,
171
                                          url=h.absurl(attach.url())) for attach in p.attachments])
172
                                          url=h.absurl(attach.url())) for attach in p.attachments])
172
                   for p in self.posts if p.status == 'ok'])
173
                   for p in self.post_class().query.find(
174
                   dict(discussion_id=self.discussion_id, thread_id=self._id, status='ok')
175
                   ).sort('timestamp', pymongo.DESCENDING)])
173
176
174
    @property
177
    @property
175
    def activity_name(self):
178
    def activity_name(self):
176
        return 'thread %s' % self.subject
179
        return 'thread %s' % self.subject
177
180