[Zope-CMF] Title() and page reloading
Pawel Lewicki
lewicki@provider.pl
Mon, 19 Aug 2002 00:17:54 +0200
Hallo,
I've got a problem. For a while I thought I got rid of it but I was wrong.
I have a box with links to personal documents of the specific types. The
problem occurs when I want to show the titles of the documents as the ids
have limited charset. I do it like this:
localFolder=context.portal_membership.getHomeFolder()
for folder in localFolder.contentItems(filter={'portal_type':['MyType',
'Folder']}):
if folder[1].portal_type=='MyType':
if folder[1].Title():print " <a
href="+str(folder[1].absolute_url())+">"+str(folder[1].Title())+"</a><br>"
else:print " <a
href="+str(folder[1].absolute_url())+">"+str(folder[0])+"</a><br>"
if folder[1].portal_type=='Folder':
if folder[1].Title():print "<h2><a
href="+str(folder[1].absolute_url())+"/folder_contents>"+str(folder[1].Title
())+"</a></h2>"
else: print "b <h2><a
href="+str(folder[1].absolute_url())+"/folder_contents>"+str(folder[0])+"</a
></h2><br>"
for dok in folder[1].contentItems(filter={'portal_type':'MyType'}):
if dok[1].Title():print " ▪ <a
href="+str(dok[1].absolute_url())+">"+str(dok[1].Title())+"</a><br>"
else:print " ▪ <a
href="+str(dok[1].absolute_url())+">"+str(dok[0])+"</a><br>"
As the result the page is being continuously reloaded. Why? Another question
is why the same solution sometimes works. I haven't worked out the
connection with the content. I tried other solutions like dok[1].title and
so on. The result is the same. If somehow I access dok[1] I can wait for a
page until I give up.
Pawel