[Zope-dev] Return variables from a DTML Method

2000-11-30 Thread bentzion

I want to change some ZClass properties by getting return results 
from a DTML Method. Something like this: dtml-call 
"myzclass.propertysheets.get('Basic').manage_changeProperties(dtmlM
eth(this(),_))". How do I get the dtmlMeth to return a Mapping? 
(or should I be doing this a different way?)

Thanks.



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Return variables from a DTML Method

2000-11-30 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  I want to change some ZClass properties by getting return results 
  from a DTML Method. Something like this: dtml-call 
  "myzclass.propertysheets.get('Basic').manage_changeProperties(dtmlM
  eth(this(),_))". How do I get the dtmlMeth to return a Mapping? 
  (or should I be doing this a different way?)

dtml-return "{ 'a' : 1, 'b': 2, }"


There will be people that say, you should not do such things
in DTML.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )




Re: [Zope-dev] Return variables from a DTML Method

2000-11-30 Thread Tres Seaver

[EMAIL PROTECTED] asked:
 
 I want to change some ZClass properties by getting return results
 from a DTML Method. Something like this: dtml-call
 "myzclass.propertysheets.get('Basic').manage_changeProperties(dtmlM
 eth(this(),_))". How do I get the dtmlMeth to return a Mapping?
 (or should I be doing this a different way?)

You *could* return a dictionary from a DTML method:

DTML Method 'return_dict'::

  dtml-return expr={ 'foo' : 0, 'bar' : 1 }

DTML Method 'show_dict'::

  dtml-var standard_html_header
  h2dtml-var title_or_id dtml-var document_title/h2

  dtml-let dict=return_dict

  p Foo: dtml-var "dict['foo']"

  p Bar: dtml-var "dict['bar']"

  /dtml-let

  dtml-var standard_html_footer

but I can't imaging wanting to.  Try to rearrange your
stuff so that the code generating the mapping can call
'manage_changeProperties()' its own self, or else move
it to PythonScripts/PythonMethods/ExternalMethods/a Product;
you'll be glad you did.

Tres.
-- 
===
Tres Seaver[EMAIL PROTECTED]
Digital Creations "Zope Dealers"   http://www.zope.org

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )