[Zope] Help! Sorting on a numeric id?

seb bacon seb@jamkit.com
13 Dec 2001 10:01:57 +0000


> > Produces:
> > 1
> > 10
> 
>    In the ZClass create a method, say "num_id", that will return numeric
> id. Something like "return int(self.id)". Sort by the method.
> 
> <dtml-in "objectValues(['ZClass'])" sort=num_id> or
> <dtml-in "objectValues(['ZClass'])" expr_sort=num_id>.

Mats, 

Just to make that explicit: you were getting your results sorted in
alphabetic order because id is a string (that may have been obvious, but
just in case...)

seb