Re: 答复: [zope-chinese] 怎样取得当前目录下对 象的id?

"Who Bruce" <[email protected]>
Newsgroups gmane.comp.web.zope.chinese
Message-ID <[email protected]>
Gary Jia:

DTML method瀹
<dtml-var standard_html_header>
<h2><dtml-var title_or_id> <dtml-var document_title></h2>
<ul>
<dtml-in ListCurruentDir>
<li><a href="&dtml-absolute_url;"><dtml-var title_or_id></a></li>
</dtml-in>
</ul>
<dtml-var standard_html_footer>

杩script(python)瀹癸idListCurruentDir锛
# Example code:

# Import a standard function, and get the HTML request and response 
objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST
RESPONSE =  request.RESPONSE

results=[]
for object in context.objectValues(['File']):
    if object.id.startswith('test'):
        results.append(object)
return results
剧ず涓ㄩㄦ浠讹规氨娌℃杈惧

璇俊
Site Error

An error was encountered while publishing this resource.

Error Type: RuntimeError
Error Value: function attributes not accessible in restricted mode

Troubleshooting Suggestions

    * The URL may be incorrect.
    * The parameters passed to this resource may be incorrect.
    * A resource that this resource relies on may be encountering an error.

For more detailed information about the error, please refer to the error 
log.

If the error persists please contact the site maintainer. Thank you for 
your patience. 

======= 2004-09-01 11:27:56 Gary Jia wrote: =======

>f洪浜杩浜锛濡璇e氨璇俊杩ョ
>
>-----欢浠-----
>浠朵汉: [email protected]
>[mailto:[email protected]] 浠h〃 Who Bruce
>堕: 2004骞91 11:05
>朵欢浜: [email protected]
>涓婚: [zope-chinese] 峰寰褰涓瀵硅薄id锛
>
>浜涓涓script(python)锛甯杩id浠test寮澶寸浠讹浣濂藉璧蜂澶у
甯
>蹇锛thanks锛
>
>results=[]
>for object in context.objectValues('File'):
>    if object.id.startswith('test'):
>        results.append(object)
>return results
>
>_________________________________________________________________
>浜ㄤ涓澶х靛欢绯荤 MSN Hotmail  http://www.hotmail.com  
>
>_______________________________________________
>zope-chinese list
>[email protected]
>http://zope.cn/mailman/listinfo/zope-chinese
>
>_______________________________________________
>zope-chinese list
>[email protected]
>http://zope.cn/mailman/listinfo/zope-chinese
>

= = = = = = = = = = = = = = = = = = = =
			

Bruce Who
[email protected]
2004-09-01

_________________________________________________________________
涓虹杩琛浜ゆ锛璇蜂娇 MSN Messenger:  http://messenger.msn.com/cn  

_______________________________________________
zope-chinese list
[email protected]
http://zope.cn/mailman/listinfo/zope-chinese
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.