Thanks! (Re: [Zope] Help with iterating thru a list of objects)
Dario Lopez-Kästen
dario@ita.chalmers.se
Fri, 6 Jul 2001 11:08:50 +0200
Michael Gutmann wrote:
> Dario Lopez-Kästen wrote:
>
> > Hello!
> >
> > I need to display the results of an sql query and I need to compare =
the
> > value of field A in the current item with the value of field A in th=
e
> > previous item, in order to display things correctly.
> <...>
>
> Well, I don't know if it fits in your case, but did you think of dtml-i=
ns
> marvellous grouping abilities? You just have to sort on an attribute
> and afterwards you can use first-<attribute> and last-<attribute> to
> determine, if the values of the attribute have changed:
>
<... snip example...>
Thanks, but I don't think this is what I need; i believe first and last only
apply to the current set in the dtml-in; I need to determine changes in the
middle of the returned set several times.
The solution that Peter Bengtsson suggested is the one I'll use; it is
exactly the same that I use in the PL/SQL appliaktion that I am porting to
Zope. I just wasn't sure that it was the best way of doing things.
Thanks to both of you for your reply. For the curious living in sweden and
working on student systems for Higher Education:
What I am porting is an app that displays the personal, relevant information
from LADOK for students that are logged in ("Studiemeritförteckning på
WWW"). I wrote it in PL/SQL first, and now I am porting it to Zope to
better integrate it with our Portal project. For details, mail me. I am not
finished yet, but I've made good progress, considering that I am on vacation
right now :-))
Sincerely,
/dario