Author: jmorliaguet
Date: Mon Jun 26 20:53:21 2006
New Revision: 3526

Modified:
   cpsskins/branches/paris-sprint-2006/locations/interfaces.py

Log:

- fixed the scope vocabulary to use value, token, and title



Modified: cpsskins/branches/paris-sprint-2006/locations/interfaces.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/locations/interfaces.py (original)
+++ cpsskins/branches/paris-sprint-2006/locations/interfaces.py Mon Jun 26 
20:53:21 2006
@@ -21,7 +21,7 @@
 from zope.i18nmessageid import MessageFactory
 from zope.schema import TextLine, Tuple, Choice, Int
 from zope.schema.interfaces import IVocabularyFactory
-from zope.schema.vocabulary import SimpleVocabulary
+from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
 
 _ = MessageFactory("cpsskins")
 
@@ -51,16 +51,15 @@
     def __str__():
         """Return the location's path"""
 
-scopes = {
-    _(u"In this folder and all sub-folders"): (0, 0),
-    _(u"Only in this folder"): (0, 1),
-    _(u"In all sub-folders"): (1, 0),
-}
-
 def ScopesVocabulary(context):
     """A vocabulary that contains a list of scopes
     """
-    return SimpleVocabulary.fromItems(scopes.items())
+    return SimpleVocabulary(
+        [SimpleTerm(value, token, title) for value, token, title in (
+            ((0, 0), u'0-0', _(u"In this folder and all sub-folders")),
+            ((0, 1), u'0-1', _(u"Only in this folder")),
+            ((1, 0), u'1-0', _(u"In all sub-folders")),
+        )])
 
 alsoProvides(ScopesVocabulary, IVocabularyFactory)
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to