Changeset 7842 for main/waeup.kofa/trunk/src
- Timestamp:
- 12 Mar 2012, 10:22:50 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/widgets/phonewidget.py
r7840 r7842 248 248 return self.template() 249 249 250 from zope.formlib.objectwidget import ObjectWidget251 from zope.schema import Object252 from waeup.kofa.widgets.objectwidget import KofaObjectWidget, ObjectWidgetView253 250 from zc.sourcefactory.contextual import BasicContextualSourceFactory 254 255 256 257 class KofaPhoneWidgetView(ObjectWidgetView):258 template = ViewPageTemplateFile('phonewidget2.pt')259 260 class PhoneWidget2(KofaObjectWidget):261 262 _fake_value = None263 264 def __init__(self, context, request, **kw):265 self._fake_context = Object(IPhoneData, __name__=context.__name__)266 super(PhoneWidget2, self).__init__(267 self._fake_context, request, PhoneWidgetData, **kw)268 return269 270 def _to_fake_value(value):271 return PhoneWidgetData(None, value.number)272 273 def _from_fake_value(value):274 return value.number275 276 def _getView(self, request):277 return KofaPhoneWidgetView(self, request)278 279 251 from zope.formlib.textwidgets import TextWidget, renderElement 280 252 from zope.component import getUtility
Note: See TracChangeset for help on using the changeset viewer.