Beispiel #1
0
def ImageFieldWidget(field, request):  # pylint: disable=invalid-name
    """Form image button widget factory adapter"""
    image = FieldWidget(field, ImageWidget(request))
    image.value = field.title
    # Get the full resource URL for the image:
    image.src = to_unicode(field.image)
    return image
Beispiel #2
0
def SelectFieldWidget(field, source, request=None):  # pylint: disable=invalid-name
    """IFieldWidget factory for SelectWidget."""
    if request is None:
        real_request = source
    else:
        real_request = request
    return FieldWidget(field, SelectWidget(real_request))
Beispiel #3
0
def HTTPMethodFieldWidget(field, request):  # pylint: disable=invalid-name
    """HTTP method getter widget factory"""
    return FieldWidget(field, HTTPMethodWidget(request))
Beispiel #4
0
def HTMLFieldWidget(field, request):  # pylint:disable=invalid-name
    """HTML field widget factory"""
    return FieldWidget(field, HTMLWidget(request))
Beispiel #5
0
def MultiFieldWidgetFactory(field, request):  # pylint: disable=invalid-name
    """IFieldWidget factory for MultiWidget."""
    return FieldWidget(field, MultiWidget(request))
Beispiel #6
0
def OrderedSelectFieldWidget(field, request):  # pylint: disable=invalid-name
    """IFieldWidget factory for SelectWidget."""
    return FieldWidget(field, OrderedSelectWidget(request))
Beispiel #7
0
def OrderedListFieldWidget(field, request):  # pylint: disable=invalid-name
    """Ordered list field widget factory"""
    return FieldWidget(field, OrderedListWidget(request))
Beispiel #8
0
def CheckBoxFieldWidget(field, request):  # pylint: disable=invalid-name
    """IFieldWidget factory for CheckBoxWidget."""
    return FieldWidget(field, CheckBoxWidget(request))
Beispiel #9
0
def SubmitFieldWidget(field, request):  # pylint: disable=invalid-name
    """Form submit button factory adapter"""
    submit = FieldWidget(field, SubmitWidget(request))
    submit.value = field.title
    return submit
Beispiel #10
0
def DirectoryHandlerHostFieldWidget(field, request):  # pylint: disable=invalid-name
    """Directory handler host widget factory"""
    return FieldWidget(field, DirectoryHandlerHostWidget(request))
Beispiel #11
0
def DateFieldWidget(field, request):  # pylint: disable=invalid-name
    """Date field widget factory"""
    return FieldWidget(field, DateWidget(request))
Beispiel #12
0
def DatetimesRangeFieldWidget(field, request):  # pylint: disable=invalid-name
    """Datetimes range widget factory"""
    return FieldWidget(field, DatetimesRangeWidget(request))
Beispiel #13
0
def TimeFieldWidget(field, request):  # pylint: disable=invalid-name
    """Time field widget factory"""
    return FieldWidget(field, TimeWidget(request))
Beispiel #14
0
def FileFieldWidget(field, request):  # pylint: disable=invalid-name
    """IFieldWidget factory for FileWidget."""
    return FieldWidget(field, FileWidget(request))
Beispiel #15
0
def TextAreaFieldWidget(field, request):  # pylint: disable=invalid-name
    """IFieldWidget factory for TextWidget."""
    return FieldWidget(field, TextAreaWidget(request))
Beispiel #16
0
def ButtonFieldWidget(field, request):  # pylint: disable=invalid-name
    """Simple form button widget factory adapter"""
    button = FieldWidget(field, ButtonWidget(request))
    button.value = field.title
    return button
Beispiel #17
0
def PasswordFieldWidget(field, request):  # pylint: disable=invalid-name
    """IFieldWidget factory for IPasswordWidget."""
    return FieldWidget(field, PasswordWidget(request))
Beispiel #18
0
def RadioFieldWidget(field, request):  # pylint: disable=invalid-name
    """IFieldWidget factory for RadioWidget."""
    return FieldWidget(field, RadioWidget(request))
Beispiel #19
0
def SingleCheckBoxFieldWidget(field, request):  # pylint: disable=invalid-name
    """IFieldWidget factory for CheckBoxWidget."""
    widget = FieldWidget(field, SingleCheckBoxWidget(request))
    widget.label = ''  # don't show the label twice
    return widget
Beispiel #20
0
def PropertiesFieldWidget(field, request):  # pylint: disable=invalid-name
    """Properties field widget factory"""
    return FieldWidget(field, PropertiesWidget(request))