[Moin-devel] editlog.getEditorData doesn't, on first record

Macleod, Ken kmacleod at ibsys.com
Mon Mar 25 12:45:15 EST 2002


I've written a Blog macro[1] that automatically includes up to 20 of the
most recently created pages "logically under" a wiki page
(<PageName>/YYYY-MM-DD).  With some suggestions (thanks Juergen!), I've made
it simpler and faster, but now I've run into a glitch that's not making
sense to me.

I was using LogIterator from macro/RecentChanges.py to step through every
page, but switched to wikiutil.getPageList.  I want to include the editor
name from the edit log in the displayed blog entry, but where
editlog.getEditorData worked fine via LogIterator, I can't get it to return
a name for the first or only record in the log using just EditLog.

The relevant lines:

     log = editlog.EditLog()
     log.filter(pagename=page_name)
     ret = ret + '<span class="blog_page"> -- by ' + log.getEditorData() \
           + " in " + inc_page.link_to() + '</span>'

I tried calling log.next() both once and in a loop, to see if I needed to
force a fetch from the log.  For pages edited more than once, getEditorData
will return the name for subsequent page edits, but for pages only created
and not re-edited I don't get the name.

Any ideas?

  -- Ken

[1] http://twistedmatrix.com/users/jh.twistd/moin/moin.cgi/macro_2fBlog_2epy




More information about the Moin-devel mailing list