[Zope-CMF] Need advice on sorting my custom CMF object

Lynn Walton waltonl@franklin.edu
Sat, 24 Nov 2001 01:11:11 -0600


Thanks so much for the helpful and quick response, Dieter!
I did write a __cmp__ method for my object.
I'm trying to use

>   2.  Sort with the versatile "sequence.sort" function.
>       You find a description in ".../DocumentTemplate/sequence/SortEx.py".

but am having trouble knowing how to use it in a ZPT.

I have tried:
<span tal:define="global sort
python:modules/DocumentTemplate.sequence.SortEx"></span>
but end up with:
I tried some other variations too but no luck.

<!--
Traceback (innermost last):
  File
/opt/WWW/ZopeInstallation/Zope-2.4.3-src/lib/python/ZPublisher/Publish.py, line
223, in publish_module
  File
/opt/WWW/ZopeInstallation/Zope-2.4.3-src/lib/python/ZPublisher/Publish.py, line
187, in publish
  File /opt/WWW/ZopeInstallation/Zope-2.4.3-src/lib/python/Zope/__init__.py,
line 226, in zpublisher_exception_hook
    (Object: joblistings)
  File
/opt/WWW/ZopeInstallation/Zope-2.4.3-src/lib/python/ZPublisher/Publish.py, line
171, in publish
  File
/opt/WWW/ZopeInstallation/Zope-2.4.3-src/lib/python/ZPublisher/mapply.py, line
160, in mapply
    (Object: testZpt)
  File
/opt/WWW/ZopeInstallation/Zope-2.4.3-src/lib/python/ZPublisher/Publish.py, line
112, in call_object
    (Object: testZpt)
  File
/opt/WWW/ZopeInstallation/Zope-2.4.3-src/lib/python/Shared/DC/Scripts/Bindings.py,
line 324, in __call__
    (Object: testZpt)
  File
/opt/WWW/ZopeInstallation/Zope-2.4.3-src/lib/python/Shared/DC/Scripts/Bindings.py,
line 354, in _bindAndExec
    (Object: testZpt)
  File
/opt/WWW/ZopeInstallation/InstanceHome/Products/PageTemplates/ZopePageTemplate.py,
line 275, in _exec
    (Object: testZpt)
  File
/opt/WWW/ZopeInstallation/InstanceHome/Products/PageTemplates/PageTemplate.py,
line 157, in pt_render
    (Object: testZpt)
  File
/opt/WWW/ZopeInstallation/Zope_software_home/lib/python/TAL/TALInterpreter.py,
line 230, in __call__
  File
/opt/WWW/ZopeInstallation/Zope_software_home/lib/python/TAL/TALInterpreter.py,
line 263, in interpret
  File
/opt/WWW/ZopeInstallation/Zope_software_home/lib/python/TAL/TALInterpreter.py,
line 478, in do_setGlobal_tal
  File /opt/WWW/ZopeInstallation/InstanceHome/Products/PageTemplates/TALES.py,
line 319, in evaluate
  File
/opt/WWW/ZopeInstallation/InstanceHome/Products/PageTemplates/ZRPythonExpr.py,
line 121, in __call__
    (Info: modules/DocumentTemplate.sequence.SortEx)
  File Python expression "modules/DocumentTemplate.sequence.SortEx", line 2, in
f
    (Object: guarded_getattr)
TALESError: Sorry, an error occurred

Thanks,
Lynn