<<TableOfContents>>
= PageDicts =

== Description ==

Deprecated in favor of MacroMarket/DictColumns 

== Download & Release Notes ==
|| Download || Release Version || Moin Version || Release Notes ||
|| [[attachment:PageDicts-0.6.py]] || 0.6 || 1.9.3  || fixed migration from 1.8 to 1.9 ||
|| [[attachment:PageDicts-0.5.py]] || 0.5 || 1.8 rc1 || changed the DataBrowserWidget {{{ return tmp.toHTML() }}} to {{{ return tmp.render() }}} ||
|| [[attachment:PageDicts-0.4.py]] || 0.4 || 1.6.3 / 1.7.0 || only fix for first reported bug  ||
|| [[attachment:PageDicts-0.3.py]] || 0.3 || 1.5 ||  ||
|| [[attachment:PageDicts-0.2.py]] || 0.2 ||  ||  ||
|| [[attachment:PageDicts.py]] ||  ||  ||  ||

== Usage ==

== Example ==
{{{[[PageDicts(Bug, Description, Status, Status ~= open)]]}}} This will show all pages which have a title like Bug, with dict keys Description and Status and which have a Status matching Open.

== Copyright ==
MichaelCohen

== License ==

= Bugs =

 1. Line 85 in version 0.2 and 0.3 does 'conditions.append(c)'. This should be 'conditions.append(condition)'. This bug will cause the macro to crash
    * fixed with version 0.4
 1. If you add a status/key that is not exist in one of the filtered/searched subpages, the macro generates a KeyError. It should be more fault tolerant and not parse the specific subpage (see [[attachment:traceback.html]] ).
 1. With MoinMoin Version 1.8.2 there is an ''attribute error''. check out this [[attachment:PageDicts-traceback.html|traceback]]. Solution is to use the new [[Macro/CollectLists]] Macro from ReimarBauer witch has similar functions. Download: [[http://hg.moinmo.in/moin/1.7-extensions/file/tip/data/plugin/macro/CollectLists.py|CollectLists.py|CollectLists.py]]

= Discussion =
I'm using this macro for something like generating a table overview about many articels/projcets (every articel is a single wikipage with some dicts and additional text; see http://lotek.heavy.ch/PageDictsExample) .

I would need the following add-ons:
 * possible to sorting the result (e.g. sorting for Description or Status)
 * don't know what's happen if I got hundreds of articel/project listen, so I would need to cache this stuff like the FullSearchCached Macro does (this is for now not first priority)

thx -- MarcelHäfner <<DateTime(2008-06-24T10:11:47+0200)>>

'' (!) It looks to me to be a good idea to use the argument parser for that macro.''

Hi 

I have added a similiar tool 
[[http://hg.moinmo.in/moin/1.7-extensions/file/tip/data/plugin/macro/CollectLists.py|CollectLists.py]] which supports the column filter of the databrowser widget.
(It is work in progress)

cheers
Reimar
----
Hi, 

I've changed a bit in your script to suit my needs: 
{{{#!python
    results = request.rootpage.getPageList(filter=re.compile(needle).search)
    results.sort()
}}}
became 
{{{#!python
    from MoinMoin import search # place this somewhere more appropriate 
    results = [p.page_name for p in search.searchPages(request, needle, sort='page_name').hits]
}}}
. This way i use the XapianIntegration engine in the background (which saves me quite a lot). I can now use the PageDicts macro like this: 
{{{
<<PageDicts(CategoryServer,naam,ip,doel,naam!~=PAGE)>>
}}}
or even use any regular expression to match page content.  <<BR>>

On a wiki with over 10.000 pages this still takes roughly ... well... it appears instantly. 

RemcoBoerma