[treeview] uuid is not available in the stdlib before python 2.5
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 03 Mar 2009 16:12:46 +0100
changeset 1001 7d0fccdb8125
parent 1000 90705536b7c8
child 1002 9a8db0c59971
[treeview] uuid is not available in the stdlib before python 2.5
web/views/treeview.py
--- a/web/views/treeview.py	Tue Mar 03 15:16:04 2009 +0100
+++ b/web/views/treeview.py	Tue Mar 03 16:12:46 2009 +0100
@@ -5,11 +5,10 @@
 :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
 """
 __docformat__ = "restructuredtext en"
-import uuid
-
 from logilab.mtconverter import html_escape
 from cubicweb.interfaces import ITree
 from cubicweb.common.selectors import implement_interface, yes
+from cubicweb.common.utils import make_uid
 from cubicweb.common.view import EntityView
 
 def treecookiename(treeid):
@@ -32,7 +31,7 @@
             if 'treeid' in self.req.form:
                 treeid = self.req.form.pop('treeid')
             else:
-                treeid = uuid.uuid1().hex
+                treeid = make_uid('throw away uid')
                 self.warning('Tree state won\'t be properly restored after next reload')
         if initial_load:
             self.req.add_css('jquery.treeview.css')