[Zope] Dymanic sort="&dtml-a_dtml_var;" in DTML?

Kapil Thangavelu kthangavelu@earthlink.net
Tue, 17 Oct 2000 16:16:13 -0700


i believe these patches are in the collector on zope.org



Seb Bacon wrote:
> 
> I needed to do this a while back and a kind fellow sent me some patches to
> do just this.  Unfortunately my old email is unavailable at the moment, so
> I've forgotten who it was.
> 
> The syntax was <dtml-in ... sort-python="sortby">
> 
> I'll dig out the patches as send them to you.
> 
> seb
> 
> > -----Original Message-----
> > From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Joel
> > Burton
> > Sent: 17 October 2000 19:22
> > To: zope@zope.org
> > Subject: [Zope] Dymanic sort="&dtml-a_dtml_var;" in DTML?
> >
> >
> > I'd like to create a DTML method that lists objects, sorting either by
> > name or modified-date. I know I can do this by:
> >
> > <dtml-if ..byname...>
> >    <dtml-in blah sort="title_or_id">
> >    ...
> > </dtml-else>
> >    <dtml-in balh sort="bobobase_modification_time">
> >    ...
> > </dtml-if>
> >
> >
> > However, this requires lots of code. I'm trying to do it like this:
> >
> >
> > Sorted by &dtml-sortby;  <!-- for debugging -->
> >
> > <dtml-in objectValues sort="&dtml-sortby;">
> >   <dtml-var title_or_id> (<dtml-var bobobase_modification_time>)
> > </dtml-in>
> >
> >
> > I have a property, sortby, of the enclosing folder set to
> > "bobobase_modification_time"; when this method is called, it
> > dutifully reports that sortby=b_m_t; however, it doesn't sort things
> > this way (I can't tell exactly how it is sorting them, and when I
> > refresh, the order occasionally changes.)
> >
> > Any ideas?
> >
> > --
> > Joel Burton, Director of Information Systems -*- jburton@scw.org
> > Support Center of Washington (www.scw.org)
> >
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists -
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> >
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )