Skip to content

ekulos/collective.select2

 
 

Repository files navigation

Contents

Select2 integration for Plone and z3c.form

Example:

from zope import schema
from zope.interface import Interface
from .field import Select2MultiField
from .field import Select2Field

class ISchema(Interface):

    users = Select2MultiField(
        title=u"Users",
        value_type=schema.Choice(
            title=u"User ID",
            source="plone.app.vocabularies.Users"
        ),
        search_view=lambda x: '{}/select2-users-search'.format(x),
        required=True
    )

    user = Select2Field(
        title=u"Single User",
        source="plone.app.vocabularies.Users",
        search_view=lambda x: '{}/select2-users-search'.format(x),
        required=True
    )

    categories = Select2MultiField(
        title=u"Categories",
        value_type=schema.TextLine(
            title=u"Category"
        ),
        search_view=lambda x: '{}/select2-subjects-search'.format(x),
        required=False
    )

About

Select2 for Plone

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 52.4%
  • CSS 41.4%
  • JavaScript 6.2%