products/CPSUid

changeset 16:3a3c5ff0e8c1 0.0.3

Added random generator to TALES expression context
author gracinet
date Wed, 02 Aug 2006 10:49:23 +0000
parents 78fd39e7f303
children b0ace3b82a57
files CHANGES uidgenerator.py
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/CHANGES
     1.2 +++ b/CHANGES
     1.3 @@ -3,7 +3,8 @@
     1.4  -
     1.5  New features:
     1.6  ~~~~~~~~~~~~~
     1.7 --
     1.8 +- One can use random() in the TALES expression. This is python standard
     1.9 +  random.random function.
    1.10  Bug fixes:
    1.11  ~~~~~~~~~~
    1.12  -
     2.1 --- a/uidgenerator.py
     2.2 +++ b/uidgenerator.py
     2.3 @@ -22,6 +22,7 @@
     2.4  counters.
     2.5  """
     2.6  
     2.7 +import random
     2.8  from logging import getLogger
     2.9  from DateTime import DateTime
    2.10  
    2.11 @@ -115,6 +116,7 @@
    2.12              mapping[keyword] = kw.get(keyword)
    2.13          mapping['DateTime'] = DateTime
    2.14          mapping['modules'] = SecureModuleImporter
    2.15 +        mapping['random'] = random.random
    2.16          # counter
    2.17          criteria = {}
    2.18          # generation criteria