def get(self, request, *args, **kwargs): from booktype.apps.reader.templatetags import reader_tags history = [] for item in self.get_queryset(): activ = reader_tags.verbose_activity(item) link_text = item.chapter.title if item.kind == 2 else activ.get('link_text') link_url = item.chapter.url_title if item.chapter else '' verbose = activ.get('verbose') if item.kind == 2: verbose = ugettext("Revision {0} saved").format(item.chapter_history.revision) history.append({ 'has_link': (item.kind == 2), 'verbose': verbose, 'username': activ.get('user').username, 'modified': activ.get('modified'), 'formatted': formats.localize(activ.get('modified')), 'link_text': link_text, 'link_url': link_url }) return self.render_json_response(history)
def get(self, request, *args, **kwargs): from booktype.apps.reader.templatetags import reader_tags history = [] for item in self.get_queryset(): activ = reader_tags.verbose_activity(item) link_text = item.chapter.title if item.kind == 2 else activ.get('link_text') link_url = item.chapter.url_title if item.chapter else '' verbose = activ.get('verbose') if item.kind == 2: verbose = ugettext("Revision {0} saved").format(item.chapter_history.revision) history.append({ 'has_link': (item.kind == 2), 'verbose': verbose, 'username': activ.get('user').username, 'modified': activ.get('modified'), 'formatted': formats.localize(activ.get('modified')), 'link_text': link_text, 'link_url': link_url }) return self.render_json_response(history)