web/views/baseviews.py
changeset 8425 b86bdc343c18
parent 8190 2a3c1b787688
parent 8418 3f87aa655466
child 8695 358d8bed9626
--- a/web/views/baseviews.py	Tue May 22 12:41:18 2012 +0200
+++ b/web/views/baseviews.py	Wed May 23 16:17:46 2012 +0200
@@ -173,9 +173,9 @@
 class OutOfContextView(EntityView):
     """:__regid__: *outofcontext*
 
-    This view is used whenthe entity should be considered as displayed out of
-    its context. By default it produces the result of ``entity.dc_long_title()`` wrapped
-    in a link leading to the primary view of the entity.
+    This view is used when the entity should be considered as displayed out of
+    its context. By default it produces the result of ``entity.dc_long_title()``
+    wrapped in a link leading to the primary view of the entity.
     """
     __regid__ = 'outofcontext'
 
@@ -612,18 +612,18 @@
     def group_key(self, entity, **kwargs):
         value = super(AuthorView, self).group_key(entity, **kwargs)
         if value:
-            return value.login
-        return value
+            return (value.name(), value.login)
+        return (None, None)
 
     def index_link(self, basepath, key, items):
-        label = u'%s [%s]' % (key, len(items))
+        label = u'%s [%s]' % (key[0], len(items))
         etypes = set(entity.__regid__ for entity in items)
         vtitle = self._cw._('%(etype)s by %(author)s') % {
             'etype': ', '.join(display_name(self._cw, etype, 'plural')
                                for etype in etypes),
             'author': label}
-        url = self.index_url(basepath, key, vtitle=vtitle)
-        title = self._cw._('archive for %(author)s') % {'author': key}
+        url = self.index_url(basepath, key[1], vtitle=vtitle)
+        title = self._cw._('archive for %(author)s') % {'author': key[0]}
         return tags.a(label, href=url, title=title)