Ejemplo n.º 1
0
def ChoiceWidgetFactory(field, request):
    vocabulary = getVocabulary(field)
    if vocabulary is None or len(vocabulary) > 4:
        widget = SelectWidget
    else:
        widget = SingleRadioWidget
    return FieldWidget(field, widget(request))
Ejemplo n.º 2
0
def ChoiceWidgetFactory(field, request):
    vocabulary=getVocabulary(field)
    if vocabulary is None or len(vocabulary)>4:
        widget=SelectWidget
    else:
        widget=SingleRadioWidget
    return FieldWidget(field, widget(request))
Ejemplo n.º 3
0
def ChoiceWidgetFactory(field, request):
    """#1537: OSHA wants Choice fields to all look alike and all be radio
    buttons.

    NuPlone on the other hand has radio buttons for items<5 and dropdown
    otherwise.

    We increase min here
    """
    vocabulary = getVocabulary(field)
    if vocabulary is None or len(vocabulary) > 6:
        widget = SelectWidget
    else:
        widget = SingleRadioWidget
    return FieldWidget(field, widget(request))
Ejemplo n.º 4
0
def ChoiceWidgetFactory(field, request):
    """ #1537: OSHA wants Choice fields to all look alike and all be radio
        buttons.

        NuPlone on the other hand has radio buttons for items<5 and dropdown
        otherwise.

        We increase min here
    """
    vocabulary = getVocabulary(field)
    if vocabulary is None or len(vocabulary) > 6:
        widget = SelectWidget
    else:
        widget = SingleRadioWidget
    return FieldWidget(field, widget(request))