RE: [Zope] How to get the type of an object by dtml

2006-12-01 Thread Christian Steinhauer

>> Could anyone help me.. how do I use DTML to return the type of the
object I'm currently working with?

If you want to get the html elements likeyou should
have a look at javascript - document.getElementsByTagName("p")

you can cominate it with for or while loops or go directly to the objecs
document.getElementsByTagName("p")[0].firstChild.data = "new";

- cs 


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] How to get the type of an object by dtml

2006-12-01 Thread Jonathan


- Original Message - 
From: "Christian Steinhauer" <[EMAIL PROTECTED]>

To: 
Sent: Friday, December 01, 2006 8:50 AM
Subject: RE: [Zope] How to get the type of an object by dtml





Could anyone help me.. how do I use DTML to return the type of the

object I'm currently working with?



I missed the beginning of this thread, but if you are trying to find out the 
basic type (int, float, list etc), you can use the same_type method.

eg.


  
found float
  


same_type will return TRUE if the two parameters are the same type. You can 
use this to test for float, int, list, etc.


hth

Jonathan



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] Zope newbie.... unicode problem

2006-12-01 Thread Dieter Maurer
Please stay on the mailing list!

Readded

Tyler Nally wrote at 2006-11-30 17:17 -0500:
>> From: Dieter Maurer [mailto:[EMAIL PROTECTED]
>>
>> It occurs when a template mixes unicode and some non unicode string
>> containing non ASCII characters.
>
>OK... very good.  How do I get my hands on the template that has the
>embedded Unicode characters?

Usually, it is not the template itself.

As the template contains text, it should (in principle) be unicode --
but Zope is still not that far. There are patches around to change
this state and Zope 2.10 might support unicode templates (but I am unsure).

Thus, usually, the template is not unicode and some dynamic parts
(included via "tal:content|replace|attributes") are unicode.


To analyse those problems (I have set Python's default encoding
to my site encoding such that I do no longer see such problems)
I would reproduce the problem in an interactive Python interpreter
("bin/zopectl debug" under *nix -- there are also solution for
Windows, but you need to search for them yourself) and use
"pdb.pm()" to find out all relevant details.



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )