[Zope] Cleaner stylr

Matt matt.bion@eudoramail.com
Thu, 26 Oct 2000 22:06:01 +1300


Hi I have the following in a method

<dtml-with text_repository>
<dtml-with "_['text_container_' + new_id]">

         <dtml-with "manage_addProduct['MyTextClasses']">
              <dtml-call "my_text_add(_.None, _, NoRedir=1)">
         </dtml-with>

</dtml-with>
</dtml-with>

The idea here is that a few levels back I have a folder called
text_repository.  The method that the obove comes from is called by a
form that sets the variable new_id.  I have already created another
folder in text_repository called text_container_new_id .... where new_id
is variable, and there are many of them.  The method above starts
throwing namespaces on the stack and then creates an instance of a text
ZClass that I have made.  It all works nicely, but seems an rather nasty
way to do it.  What are preferred ways of doing this ?  and is this
really something that people feel is better in an external method as
opposed to a dtml method.

The reason why I am backtracking all over the place is because I tend to
put my methods and forms into a sub folder, which may not be the best
idea.  I.e. the hierachy is somwhat as follows :

text_main /text_methods/text_add_form_method
text_main /text_methods/text_accept_method(which is where above snippet
is from)
text_main/text_repository/
text_main/text_repository/text_container_15562/
text_main/text_repository/text_container_15562/text_ZClass_instance1
text_main/text_repository/text_container_15562/text_ZClass_instance2

regards
Matt