Index: main/waeup.widgets.core/trunk/src/waeup/widgets/core/dictwidget.py
===================================================================
--- main/waeup.widgets.core/trunk/src/waeup/widgets/core/dictwidget.py	(revision 5291)
+++ main/waeup.widgets.core/trunk/src/waeup/widgets/core/dictwidget.py	(revision 5292)
@@ -34,9 +34,5 @@
 class DictWidget(SequenceWidget):
     _type = dict
-    #grok.adapts(IDict, IField, IBrowserRequest)
-    #grok.adapts(IDict, IBrowserRequest)
-    #grok.provides(ISimpleInputWidget)
     template = ViewPageTemplateFile('dictwidget.pt')
-
     
     def __init__(self, context, request, subwidget=None):
@@ -66,5 +62,4 @@
                 key_widget = getMultiAdapter(
                     (key_field, self.request), IInputWidget)
-            #key_widget.setPrefix('%s.key.%d.' % (self.name, i))
             key_widget.setPrefix('%s.key.%d.' % (self.name, i))
             
@@ -75,12 +70,9 @@
                 value_widget = getMultiAdapter(
                     (value_field, self.request), IInputWidget)
-            #value_widget.setPrefix('%s.value.%d.' % (self.name, i))
             value_widget.setPrefix('%s.value.%d.' % (self.name, i))
-            #import pdb; pdb.set_trace()
+
             if not self.preserve_widgets:
-                #return super(DictWidget, self)._getWidget(i)
                 return (key_widget, value_widget)
             self._widgets[i] = (key_widget, value_widget)
-        #return super(DictWidget, self)._getWidget(i)
         return self._widgets[i]
             
@@ -133,6 +125,4 @@
         # pre-populate
         sequence = [(None, None)] * count
-        #sequence = [None] * count
-        #sequence = dict()
 
         # now look through the request for interesting values
@@ -140,5 +130,4 @@
         removing = self.name + ".remove" in self.request.form
         for i in reversed(range(count)):
-            #widget = self._getWidget(i)
             key_widget, value_widget = self._getWidget(i)
             key = None
@@ -148,5 +137,4 @@
                 try:
                     key = key_widget.getInputValue()
-                    #sequence[i] = widget.getInputValue()
                 except WidgetInputError, error:
                     self._error = error
@@ -156,16 +144,8 @@
                 try:
                     value = value_widget.getInputValue()
-                    #sequence[i] = widget.getInputValue()
                 except WidgetInputError, error:
                     self._error = error
                     raise self._error
             sequence[i] = (key, value)
-            #if widget.hasValidInput():
-            #    # catch and set sequence widget errors to ``_error`` attribute
-            #    try:
-            #        sequence[i] = widget.getInputValue()
-            #    except WidgetInputError, error:
-            #        self._error = error
-            #        raise self._error
 
             remove_key = "%s.remove_%d" % (self.name, i)
@@ -196,5 +176,4 @@
         sequence = super(DictWidget, self).getInputValue()
         return sequence
-        return self._type(sequence)
 
     def _getRenderedValue(self):
@@ -202,24 +181,13 @@
         if self._renderedValueSet():
             if self._data is self.context.missing_value:
-                #sequence = []
                 sequence = dict()
             else:
-                #sequence = list(self._data)
                 sequence = dict(self._data)
         elif self.hasInput():
-            #sequence = self._generateSequence()
             sequence = dict(self._generateSequence())
         elif self.context.default is not None:
-            #sequence = self.context.default
             sequence = self.context.default
         else:
-            #sequence = []
             seuence = dict()
-        # ensure minimum number of items in the form
-        #while len(sequence) < self.context.min_length:
-        #    # Shouldn't this use self.field.value_type.missing_value,
-        #    # instead of None?
-        #    #sequence.append(None)
-        #    pass
         return sequence
 
@@ -231,8 +199,5 @@
         change = field.query(content, self) != value
         if change:
-            print "SET: ", field, content, value
             field.set(content, value)
-        else:
-            print "NO SET: ", field, content, value
         return change
 
@@ -254,5 +219,4 @@
 
     def __init__(self, context, request, subwidget=None):
-        # def __init__(self, context, field, request, subwidget=None):
         super(DictDisplayWidget, self).__init__(context, request)
         self.subwidget = subwidget
@@ -260,5 +224,4 @@
     def __call__(self):
         # get the data to display:
-        #import pdb; pdb.set_trace()
         if self._renderedValueSet():
             data = self._data
@@ -269,5 +232,4 @@
         if data == self.context.missing_value:
             return translate(self._missingValueMessage, self.request)
-        #data = list(data)
         data = dict(data)
         if not data:
@@ -275,12 +237,8 @@
 
         parts = []
-        # for i, item in enumerate(data):
         for i, item in enumerate(data.items()):
-            #widget = self._getWidget(i)
             key_widget, value_widget = self._getWidget(i)
             key_widget.setRenderedValue(item[0])
             value_widget.setRenderedValue(item[1])
-            #widget.setRenderedValue(item)
-            #s = widget()
             s = "%s: %s" % (key_widget(), value_widget())
             if self.itemTag:
