RE: [Zope] Underscore Caracter
At 9/5/00 09:54 PM, Chris McDonough wrote:
It should be noted that _.string.replace() is not mentioned in the DTML reference guide. If it exists, it should be used. Sigh. I can't wait for the Zope Book to come out, I'm going to be the first buyer. ;-)
Not that I would expect it to exist, but according to "Python Essential Reference" p. 117, it is indeed present in the string module: replace( str, old, new [,max] ) -- Dennis Nichols nichols@tradingconnections.com
Yes. Thank you. Note however that methods of modules accessed via the underscore namespace may be filtered individually, so although 'replace' exists as a method of the Python string module, this does not necessarily make it accessible implicitly through Zope via _.string.replace. It happens to be accessible in this case, but I'd bet there are cases in which methods accessible via modules of the _ namespace have been removed for "safe scripting" purposes. The solution is proper documentation. On Tue, 5 Sep 2000, Dennis Nichols wrote:
At 9/5/00 09:54 PM, Chris McDonough wrote:
It should be noted that _.string.replace() is not mentioned in the DTML reference guide. If it exists, it should be used. Sigh. I can't wait for the Zope Book to come out, I'm going to be the first buyer. ;-)
Not that I would expect it to exist, but according to "Python Essential Reference" p. 117, it is indeed present in the string module:
replace( str, old, new [,max] )
-- Dennis Nichols nichols@tradingconnections.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Chris McDonough Digital Creations, Publishers of Zope http://www.zope.org
Chris McDonough wrote:
Yes. Thank you.
Note however that methods of modules accessed via the underscore namespace may be filtered individually, so although 'replace' exists as a method of the Python string module, this does not necessarily make it accessible implicitly through Zope via _.string.replace. It happens to be accessible in this case, but I'd bet there are cases in which methods accessible via modules of the _ namespace have been removed for "safe scripting" purposes.
having recently gone through the code to produce ZModules (defined interface for adding modules to _), it was apparent that all the modules that live in namespace are completely exposed. Kapil
Hi, In the management view of a Catalog (ex. /Catalog), there is a tab named "Find items to ZCatalog". In that tab, there is a field "Find objects of type:". The options listed there were retrieved from the "factory" of a ZClass. (The "add list name" field, a good feature for people who are not native speakers of English.). I doubt that what "Find items to ZCatalog" actually searched is the meta_type of the objects not the value of "add list name" in its ZClass. Because I have to identify these two in order to find my items to ZCalalog. Is that true? Iap, Singuan
Chris McDonough wrote:
Yes. Thank you.
Note however that methods of modules accessed via the underscore namespace may be filtered individually, so although 'replace' exists as a method of the Python string module, this does not necessarily make it accessible implicitly through Zope via _.string.replace. It happens to be accessible in this case, but I'd bet there are cases in which methods accessible via modules of the _ namespace have been removed for "safe scripting" purposes.
having recently gone through the code to produce ZModules (defined interface for adding modules to _), it was apparent that all the modules that live in namespace are completely exposed.
What's the problem with that? Aren't most, if not all, the modules living in the _ namespace just standard python modules available anyways? Knight
participants (5)
-
Chris McDonough -
Dennis Nichols -
iap_y2fun.com -
Kapil Thangavelu -
knight