Esempio 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))
Esempio 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))
Esempio 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))
Esempio 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))