from dependencies.dependency import ClassSecurityInfo from dependencies.dependency import TypesWidget from dependencies.dependency import registerWidget from dependencies.dependency import registerPropertyType from lims.browser import ulocalized_time as ut class DateTimeWidget(TypesWidget): _properties = TypesWidget._properties.copy() _properties.update( { "show_time": False, "macro": "bika_widgets/datetimewidget", "helper_js": ("bika_widgets/datetimewidget.js",), "helper_css": ("bika_widgets/datetimewidget.css",), } ) security = ClassSecurityInfo() def ulocalized_time(self, time, context, request): val = ut(time, long_format=self._properties["show_time"], time_only=False, context=context, request=request) return val registerWidget( DateTimeWidget, title="DateTimeWidget", description=("Simple text field, with a jquery date widget attached.") ) registerPropertyType("show_time", "boolean")
from dependencies.dependency import DecimalWidget as _d from dependencies.dependency import registerPropertyType from dependencies.dependency import registerWidget from dependencies.dependency import ClassSecurityInfo _marker = [] class DecimalWidget(_d): _properties = _d._properties.copy() _properties.update({ 'macro': "bika_widgets/decimal", 'unit': '', }) security = ClassSecurityInfo() registerWidget(DecimalWidget, title='Decimal', description=('Renders a HTML text input box which ' 'accepts a fixed point value'), ) registerPropertyType('unit', 'string', DecimalWidget)
from dependencies.dependency import IntegerWidget as _i from dependencies.dependency import registerPropertyType from dependencies.dependency import registerWidget from dependencies.dependency import ClassSecurityInfo _marker = [] class IntegerWidget(_i): _properties = _i._properties.copy() _properties.update({ 'macro': "bika_widgets/integer", 'unit': '', }) security = ClassSecurityInfo() registerWidget( IntegerWidget, title='Integer', description=('Renders a HTML text input box which ' 'accepts a integer value'), ) registerPropertyType('unit', 'string', IntegerWidget)
from dependencies.dependency import DecimalWidget as _d from dependencies.dependency import registerPropertyType from dependencies.dependency import registerWidget from dependencies.dependency import ClassSecurityInfo _marker = [] class DecimalWidget(_d): _properties = _d._properties.copy() _properties.update({ 'macro': "bika_widgets/decimal", 'unit': '', }) security = ClassSecurityInfo() registerWidget( DecimalWidget, title='Decimal', description=('Renders a HTML text input box which ' 'accepts a fixed point value'), ) registerPropertyType('unit', 'string', DecimalWidget)
from dependencies.dependency import IntegerWidget as _i from dependencies.dependency import registerPropertyType from dependencies.dependency import registerWidget from dependencies.dependency import ClassSecurityInfo _marker = [] class IntegerWidget(_i): _properties = _i._properties.copy() _properties.update({ 'macro': "bika_widgets/integer", 'unit': '', }) security = ClassSecurityInfo() registerWidget(IntegerWidget, title='Integer', description=('Renders a HTML text input box which ' 'accepts a integer value'), ) registerPropertyType('unit', 'string', IntegerWidget)
from dependencies.dependency import registerPropertyType from lims.browser import ulocalized_time as ut class DateTimeWidget(TypesWidget): _properties = TypesWidget._properties.copy() _properties.update({ 'show_time': False, 'macro': "bika_widgets/datetimewidget", 'helper_js': ("bika_widgets/datetimewidget.js", ), 'helper_css': ("bika_widgets/datetimewidget.css", ), }) security = ClassSecurityInfo() def ulocalized_time(self, time, context, request): val = ut(time, long_format=self._properties['show_time'], time_only=False, context=context, request=request) return val registerWidget( DateTimeWidget, title='DateTimeWidget', description=('Simple text field, with a jquery date widget attached.')) registerPropertyType('show_time', 'boolean')