Never mind. I just figured out the DateTime() thing. (replace time.time() below with DateTime()). Although it seems a strange way to report an error. *********** REPLY SEPARATOR *********** On 5/15/01 at 10:00 AM Bruce Eckel wrote:
The following script follows all the rules, I think. It saves fine, and I usually get an exception when I save a script if there's something wrong with it. But when I try to run it, it pops up the "Please type your user name and password" dialog box, and it will not accept my "root" zope admin password.
## Script (Python) "SeminarID" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=name ##title= ## import string, time
order_id = string.join(string.split(string.strip(name)), '') # Remove spaces idstring = ''
for c in order_id: if c in string.letters: # Take only characters idstring = idstring + c order_id = idstring[0:20] # Take only the first 20 characters order_id = "%s%x" % (order_id, time.time()) # Combine with current time in hex for unique ID return order_id
Most current information can be found at: http://www.mindview.net/Etc/notes.html =================== Bruce Eckel http://www.BruceEckel.com Contains free electronic books: "Thinking in Java 2e" & "Thinking in C++ 2e" Please subscribe to my free newsletter -- just send any email to: join-eckel-oo-programming@earth.lyris.net My schedule can be found at: http://www.mindview.net/Calendar ===================
_______________________________________________ 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 )
Most current information can be found at: http://www.mindview.net/Etc/notes.html =================== Bruce Eckel http://www.BruceEckel.com Contains free electronic books: "Thinking in Java 2e" & "Thinking in C++ 2e" Please subscribe to my free newsletter -- just send any email to: join-eckel-oo-programming@earth.lyris.net My schedule can be found at: http://www.mindview.net/Calendar ===================