Updated widget class hierarchy
authorThierry Florac <tflorac@ulthar.net>
Wed, 17 Oct 2018 16:10:52 +0200
changeset 1023 fac2e007432b
parent 1022 2a0a220c2e81
child 1024 cbc4b53f6dd2
Updated widget class hierarchy
src/pyams_content/component/extfile/zmi/widget.py
--- a/src/pyams_content/component/extfile/zmi/widget.py	Wed Oct 17 15:44:50 2018 +0200
+++ b/src/pyams_content/component/extfile/zmi/widget.py	Wed Oct 17 16:10:52 2018 +0200
@@ -9,6 +9,8 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
+from pyams_i18n.interfaces.widget import II18nTextLineWidget
+
 
 __docformat__ = 'restructuredtext'
 
@@ -24,13 +26,17 @@
 from pyams_i18n.widget import I18nTextLineWidget
 
 
-class IExtFileTitleFieldWidget(ITextWidget):
-    """external file title field widget interface"""
+#
+# External file title field widget
+#
+
+class IExtFileTitleWidget(ITextWidget):
+    """External file title field widget interface"""
 
 
 @widgettemplate_config(mode=INPUT_MODE, template='templates/extfile-title-input.pt', layer=IFormLayer)
 @widgettemplate_config(mode=DISPLAY_MODE, template='templates/extfile-title-display.pt', layer=IFormLayer)
-@implementer_only(IExtFileTitleFieldWidget)
+@implementer_only(IExtFileTitleWidget)
 class ExtFileTitleWidget(TextWidget):
     """External file title widget"""
 
@@ -49,8 +55,21 @@
     return FieldWidget(field, ExtFileTitleWidget(request))
 
 
+#
+# I18n external file title field widget
+#
+
+class II18nExtFileTitleWidget(II18nTextLineWidget):
+    """I18n external file title field widget interface"""
+
+
+@implementer_only(II18nExtFileTitleWidget)
+class I18nExtFileTitleWidget(I18nTextLineWidget):
+    """I18n external file title widget"""
+
+
 def I18nExtFileTitleFieldWidget(field, request):
     """I18n external file title widget factory"""
-    widget = I18nTextLineWidget(request)
+    widget = I18nExtFileTitleWidget(request)
     widget.widget_factory = ExtFileTitleFieldWidget
     return FieldWidget(field, widget)