zope writing python code in the index_html page
I am very new to zope and pl tal:one. I am trying to write python code in the index_html page. I have the list of objects of person, now I want to reorder them. So, what I had before was:

    <ul tal:define="persons python: context.portal_catalog(portal_type='Person');">
    <tal: listing repeat="p persons">

Now I have this python code before the `<tal:listing`...

    <?python
      order=[0,2,1]
      persons = [persons[i] for i in order]
    ?>

But somehow the order of the person remains the same. Also, I also don't like this way of writing python code in the view. Is there any way I could use this code for changing the order of the list?

zope writing python code in the index_html page
===

I am very new to zope and pl tal:one. I am trying to write python code in the index_html page. I have the list of objects of person, now I want to reorder them. So, what I had before was:

    <ul tal:define="persons python: context.portal_catalog(portal_type='Person');">
    <tal: listing repeat="p persons">

Now I have this python code before the `<tal:listing`...

    <?python
      order=[0,2,1]
      persons = [persons[i] for i in order]
    ?>

But somehow the order of the person remains the same. Also, I also don't like this way of writing python code in the view. Is there any way I could use this code for changing the order of the list?
