[Zope] Complex <dtml-in> query sorting

Thierry FLORAC thierry.florac@onf.fr
Wed, 12 Mar 2003 19:30:41 +0100


  Hi,

I have to use a <dtml-in> code to handle a quite complex thing :
 - I have an SQL method, which retrieves an object OID ; this OID is a 
globally unique identifier, which is cataloged and used in all my objects.
 - I have a Zope method at my site root, called "getObject(oid)", which for a 
given OID retrieve the corresponding Zope object
 - each object also have a custom method called "getSortValue()" which 
retrieves a sort value !!

My code (in a DTML method) is like :

<dtml-in "[getObject(record['oid']) for record in sql_method(params)]" 
sort_expr="getSortValue()">

The <dtml-in> loop works well and retrieves my object, but the "sort_expr" 
attribute doesn't work and so results are not sorted ; it seems that 
"getSortValue()" is not called on the good object...
What should I have to do for this to work ???

Thanks for any help,

  Thierry

-- 
  Linux every day, keeps Dr Watson away...
  http://gpc.sourceforge.net -- http://www.ulthar.net