Currency formatting from within Python Script
Does anyone have a quick, easy way to format float variables to something like a currency (e.g., 1,234.56)? Use of the locale module (normally used for currency issues) is unauthorized within a Python Script. Surely someone must have run into this before. Ron
if you need to access the locale module inside PythonScript, you can lift the access restrictions (see README in the PythonScripts directory). -aj ----- Original Message ----- From: <complaw@hal-pc.org> To: <zope@zope.org> Sent: Tuesday, January 08, 2002 11:45 Subject: [Zope] Currency formatting from within Python Script
Does anyone have a quick, easy way to format float variables to something like a currency (e.g., 1,234.56)? Use of the locale module (normally used for currency issues) is unauthorized within a Python Script.
Surely someone must have run into this before.
Ron
_______________________________________________ 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 )
Hi, in order to upgrade existing instances of a Product (which changed - see previous mails), I now use the following approach in the repair() function of my product: 1) delete all dtml-pages in the instance 2) add all dtml-pages from the product to the instance I use this approach because I have already the function which does 2). Now I browsed through the ObjectManager API, but I cannot find a way to delete a certain child-object. How can I do that? sorry if this is a dumb question (; Andreas
<snip>
I use this approach because I have already the function which does 2). Now I browsed through the ObjectManager API, but I cannot find a way to delete a certain child-object. How can I do that?
Assuming 'parent_folder' is a variable holding the parent folder object of what you are trying to delete and 'id' is the id of what you want to delete, I think this is what you want... parent_folder.manage_delObjects(id)
From what it says in the ZQR, I think you can pass in a list of id's to do multiple deletes in one go. You can find the ZQR here http://www.zope.org/Members/ZQR/zqr/normal in case you haven't come across it yet.
tim
Tim Hicks writes:
<snip>
I use this approach because I have already the function which does 2). Now I browsed through the ObjectManager API, but I cannot find a way to delete a certain child-object. How can I do that?
Assuming 'parent_folder' is a variable holding the parent folder object of what you are trying to delete and 'id' is the id of what you want to delete, I think this is what you want...
parent_folder.manage_delObjects(id) Almost - note the plural:
"manage_delObjects" needs a sequence of ids. Therefore, you need to use parent_folder.manage_delObjects([id]) Dieter
participants (5)
-
Andreas Jung -
Andreas Leitner -
complaw@hal-pc.org -
Dieter Maurer -
Tim Hicks