How do I construct a method of an object, so that whenever that method
is called, the current namespace is passed with it?


class myclass:
        def myfunc(self, context):
                if context['sequence-index'] == 10:
                        raise 'sequence-index is %s' % \

called from DTML, like so:

<dtml-in "objectValues('Spam')">
        <dtml-var myfunc>

will raise an exception if sequence-index is 10 or more?

Specifically, the reason I want this function is that I feel using

<dtml-if sequence-even>
        <tr bgcolor="<dtml-var color_sequence_even>">
        <tr bgcolor="<dtml-var color_sequence_odd>">

is a bit tedious (and ugly!) in the long run..

If this isn't implemented, where would the right place to implement it


Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to