[pmwiki-users] Filter and sort data with ZAP

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Wed Nov 15 08:44:57 CST 2006


Caveman,

This is really near of what I had in mind. Can't we just store the records in one single page? One page per record seems cumbersome
to me... There could be a sort of table that we store in a page and that we can filter/sort data from. Most databases we make do not
have to be relational. A simple table is often sufficient to make most jobs.

Pierre

> -----Message d'origine-----
> De : pmwiki-users-bounces at pmichaud.com [mailto:pmwiki-users-bounces at pmichaud.com] De la part de The
> Editor
> Envoyé : 14 novembre 2006 17:49
> À : pmwiki-users
> Objet : Re: [pmwiki-users] Filter and sort data with ZAP
> 
> On 11/14/06, Pierre Racine <Pierre.Racine at sbf.ulaval.ca> wrote:
> > Actually I want to simulate a database without a database (databases suck and this is the main
> reason I use PmWiki: no database). I
> > want to store a bunch of records (users profiles), display all of them (sorted) in one page and
> display some of them (using filter
> > and sort) in another page.
> >
> > I think I'm ready for an example...
> >
> > Pierre
> 
> 
> No problem Pierre.  That's exactly what ZAP was created for and for
> the same reasons. You will need the latest version of PmWiki (the
> beta).
> 
> Here's what you do.  1) save each record to a different page in the
> same group:  Profiles.Name1, Profiles.Name2, Profiles.Name3, etc.  You
> can use any fields you want for these records.  Look at the Register
> Snippet for a sample you could modify to your need. Leave off the
> nextpage field to enter multiple records.
> 
> (Currently there's no way to import a bunch of records automatically).
> 
> 2) to retrieve the data, do a pagelist.  Let's say you wanted a list
> of all the phone numbers of members in Texas you might do something
> like (not tested):
> 
> (:pagelist group=Profiles state=Texas fmt=#phonebystate:)
> 
> [[#phonebystate]]
> (:if equal {{=$FullName}$:State} $$state:) {{=$FullName}$:Phone}
> (:ifend:)
> [[#phonebystateend]]
> 
> I should note, you can make this even more dynamic using some of the
> tricks in the ZAP snippet Pagelist Fun.  Hope this helps.
> 
> Cheers,
> Caveman
> 
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users





More information about the pmwiki-users mailing list