[Checkins] SVN: z3ext.skintool/trunk/ Use custom fields for schema

Nikolay Kim fafhrd at datacom.kz
Sun Jan 25 14:59:13 EST 2009


Log message for revision 95010:
  Use custom fields for schema

Changed:
  U   z3ext.skintool/trunk/CHANGES.txt
  U   z3ext.skintool/trunk/setup.py
  U   z3ext.skintool/trunk/src/z3ext/skintool/configure.zcml
  U   z3ext.skintool/trunk/src/z3ext/skintool/interfaces.py
  U   z3ext.skintool/trunk/src/z3ext/skintool/vocabulary.py

-=-
Modified: z3ext.skintool/trunk/CHANGES.txt
===================================================================
--- z3ext.skintool/trunk/CHANGES.txt	2009-01-25 16:15:52 UTC (rev 95009)
+++ z3ext.skintool/trunk/CHANGES.txt	2009-01-25 19:59:13 UTC (rev 95010)
@@ -2,6 +2,12 @@
 CHANGES
 =======
 
+1.1.2 (2009-01-26)
+------------------
+
+- Use custom fields for schema
+
+
 1.1.1 (2008-12-03)
 ------------------
 

Modified: z3ext.skintool/trunk/setup.py
===================================================================
--- z3ext.skintool/trunk/setup.py	2009-01-25 16:15:52 UTC (rev 95009)
+++ z3ext.skintool/trunk/setup.py	2009-01-25 19:59:13 UTC (rev 95010)
@@ -67,6 +67,8 @@
                           'zope.i18n',
 			  'z3c.autoinclude',
 			  'z3ext.controlpanel',
+			  'z3ext.widget.radio',
+			  'z3ext.widget.checkbox',
                           ],
       extras_require = dict(test=['zope.app.testing',
                                   'zope.testing',

Modified: z3ext.skintool/trunk/src/z3ext/skintool/configure.zcml
===================================================================
--- z3ext.skintool/trunk/src/z3ext/skintool/configure.zcml	2009-01-25 16:15:52 UTC (rev 95009)
+++ z3ext.skintool/trunk/src/z3ext/skintool/configure.zcml	2009-01-25 19:59:13 UTC (rev 95010)
@@ -27,13 +27,6 @@
      class=".tool.SkinTool"
      schema=".interfaces.ISkinTool" />
 
-  <z3ext:pagelet
-     name="index.html"
-     for=".interfaces.ISkinTool"
-     template="configlet.pt"
-     class=".configlet.SkintoolEditForm"
-     permission="z3ext.Configure" />
-
   <!-- translations -->
   <i18n:registerTranslations directory="locales"/>
 

Modified: z3ext.skintool/trunk/src/z3ext/skintool/interfaces.py
===================================================================
--- z3ext.skintool/trunk/src/z3ext/skintool/interfaces.py	2009-01-25 16:15:52 UTC (rev 95009)
+++ z3ext.skintool/trunk/src/z3ext/skintool/interfaces.py	2009-01-25 19:59:13 UTC (rev 95010)
@@ -17,6 +17,8 @@
 """
 from zope import schema, interface
 from zope.i18nmessageid import MessageFactory
+from z3ext.widget.radio.field import RadioChoice
+from z3ext.widget.checkbox.field import CheckboxList
 
 _ = MessageFactory('z3ext.skintool')
 
@@ -42,16 +44,16 @@
 class ISkinTool(interface.Interface):
     """ skin tool, allow generate skin on the fly """
 
-    skin = schema.Choice(
+    skin = RadioChoice(
         title = _('Skin'),
         description = _(u'Select portal skin.'),
         vocabulary = "z3ext skins",
         required = False)
 
-    layers = schema.List(
+    layers = CheckboxList(
         title = _(u'Layers'),
         description = _(u'Select skin layers.'),
-        value_type = schema.Choice(vocabulary = "z3ext layers"),
+        vocabulary = "z3ext layers",
         default = [],
         required = False)
 

Modified: z3ext.skintool/trunk/src/z3ext/skintool/vocabulary.py
===================================================================
--- z3ext.skintool/trunk/src/z3ext/skintool/vocabulary.py	2009-01-25 16:15:52 UTC (rev 95009)
+++ z3ext.skintool/trunk/src/z3ext/skintool/vocabulary.py	2009-01-25 19:59:13 UTC (rev 95010)
@@ -37,11 +37,12 @@
     def __call__(self, context):
         terms = []
         for layer, info in tool.skins_registry.items():
-            terms.append((info[2], info[1]))
+            term = SimpleTerm(info[1], info[1], info[2])
+            term.description = info[3]
+            terms.append((info[2], info[1], term))
 
         terms.sort()
-        return Vocabulary(
-            [SimpleTerm(name,name,title) for title, name in terms])
+        return Vocabulary([term for title, name, term in terms])
 
 
 class LayersVocabulary(object):
@@ -50,8 +51,9 @@
     def __call__(self, context):
         terms = []
         for layer, info in tool.layers_registry.items():
-            terms.append((info[2], info[1]))
+            term = SimpleTerm(info[1], info[1], info[2])
+            term.description = info[3]
+            terms.append((info[2], info[1], term))
 
         terms.sort()
-        return Vocabulary(
-            [SimpleTerm(name,name,title) for title, name in terms])
+        return Vocabulary([term for title, name, term in terms])



More information about the Checkins mailing list