[Zope3-checkins] CVS: Products3/NewsSite/NewsItem - browser.py:1.7 info.pt:1.7
Volker Bachschneider
vbachs@dzug.org
Thu, 27 Mar 2003 08:40:54 -0500
Update of /cvs-repository/Products3/NewsSite/NewsItem
In directory cvs.zope.org:/tmp/cvs-serv13102
Modified Files:
browser.py info.pt
Log Message:
=== Products3/NewsSite/NewsItem/browser.py 1.6 => 1.7 ===
--- Products3/NewsSite/NewsItem/browser.py:1.6 Thu Mar 27 07:12:07 2003
+++ Products3/NewsSite/NewsItem/browser.py Thu Mar 27 08:40:53 2003
@@ -33,15 +33,25 @@
self.request = request
def getCreator(self):
- user = getAdapter(self.context, ICMFDublinCore).Creator()
+ users = getAdapter(self.context, ICMFDublinCore).Creator()
service = getService(self.context, servicenames.Authentication)
- try:
- user = service.getPrincipal(user)
- member = getAdapter(user, IMember).realname
- except NotFoundError:
- member = u'Unknown'
+ members = []
+ for user in users:
+ principal = None
+ username = None
+ try:
+ principal = service.getPrincipal(user)
+ username += getAdapter(principal, IMember).realname
+ except NotFoundError:
+ if principal:
+ username = principal.getTitle()
+ if not username:
+ username = user
+ if username:
+ members.append(username)
+
- return member
+ return tuple(members)
def createdString(self):
return self._dateString(getAdapter(self.context,
=== Products3/NewsSite/NewsItem/info.pt 1.6 => 1.7 ===
--- Products3/NewsSite/NewsItem/info.pt:1.6 Thu Mar 27 07:12:07 2003
+++ Products3/NewsSite/NewsItem/info.pt Thu Mar 27 08:40:53 2003
@@ -5,9 +5,9 @@
<body>
<div metal:fill-slot="body">
<h2 tal:content="context/title">News Message</h2>
-<p> Creator: <em tal:content="view/getCreator">Creator</em></p>
+<p> Creator: <em tal:content="python: ', '.join(view.getCreator())">Creator</em></p>
<p> <em tal:content="context/lead">News Message</em></p>
-<p> <pre tal:content="context/newsbody">News Message</pre></p>
+<p tal:content="context/newsbody">News Message</p>
<p> Effective:
<span tal:content="view/effectiveString">Effective</span>
Expires: