21 from z3c.table.interfaces import IColumn, IValues |
21 from z3c.table.interfaces import IColumn, IValues |
22 from zope.interface import Invalid, implementer |
22 from zope.interface import Invalid, implementer |
23 |
23 |
24 from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION, MANAGE_TOOL_PERMISSION |
24 from pyams_content.interfaces import MANAGE_CONTENT_PERMISSION, MANAGE_TOOL_PERMISSION |
25 from pyams_content.reference.pictograms.zmi.widget import PictogramSelectFieldWidget |
25 from pyams_content.reference.pictograms.zmi.widget import PictogramSelectFieldWidget |
|
26 from pyams_content.shared.common import IWfSharedContent |
26 from pyams_content.shared.common.interfaces.types import IBaseDataType, IDataType, ISubType, \ |
27 from pyams_content.shared.common.interfaces.types import IBaseDataType, IDataType, ISubType, \ |
27 ITypedDataManager, ITypedSharedTool, IWfTypedSharedContent |
28 ITypedDataManager, ITypedSharedTool, IWfTypedSharedContent |
28 from pyams_content.shared.common.types import DataType, SubType |
29 from pyams_content.shared.common.types import DataType, SubType |
29 from pyams_content.shared.common.zmi import SharedContentAddForm |
30 from pyams_content.shared.common.zmi import SharedContentAddForm |
30 from pyams_content.shared.common.zmi.properties import SharedContentPropertiesEditForm |
31 from pyams_content.shared.common.zmi.properties import SharedContentPropertiesEditForm |
393 # |
394 # |
394 |
395 |
395 class TypedSharedContentAddForm(SharedContentAddForm): |
396 class TypedSharedContentAddForm(SharedContentAddForm): |
396 """Typed shared content add form""" |
397 """Typed shared content add form""" |
397 |
398 |
398 fields = field.Fields(IWfTypedSharedContent).select('title', 'data_type', 'notepad') |
399 fields = field.Fields(IWfSharedContent).select('title') + \ |
|
400 field.Fields(IWfTypedSharedContent).select('data_type') + \ |
|
401 field.Fields(IWfSharedContent).select('notepad') |
399 |
402 |
400 def updateWidgets(self, prefix=None): |
403 def updateWidgets(self, prefix=None): |
401 super(TypedSharedContentAddForm, self).updateWidgets(prefix) |
404 super(TypedSharedContentAddForm, self).updateWidgets(prefix) |
402 if 'data_type' in self.widgets: |
405 if 'data_type' in self.widgets: |
403 self.widgets['data_type'].prompt = True |
406 self.widgets['data_type'].prompt = True |