New Config Value Type

Issue #175 resolved
Chris Drew
created an issue

I think we should have a new config value called something like StringValueChoice which allows the user to pick 1 option. Essentially it is just like the MultipleStringValue but only allows 1 choice.

For example, the credit card modules might have 2 or three choices for the type of credit card authorization. It would be nice to present a single choice for the user to choose.

Comments (2)

  1. Anonymous

    Just use StringValue and give it a choice tuple. It already automatically uses a select box and forces just one choice. For example, see the newsletter example:

    NEWSLETTER_ACTIVE = config_register(StringValue(NEWSLETTER_GROUP,
        'MODULE',
        description=_("Active newsletter module"),
        help_text=_("Select a newsletter, save and reload to set any module-specific newsletter settings."),
        default="satchmo.newsletter.simple",
        choices=[('satchmo.newsletter.ignore', _('No newsletter')),
                ('satchmo.newsletter.simple', _('Simple list')),
                 ('satchmo.newsletter.mailman', _('Mailman'))]
        ))
       
    
  2. Log in to comment