Skip to main content

User token widget

Project description

Introduction

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),
        placeholder="Search and select a user",
        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
    )

Contributors

  • Giorgio Borelli [gborelli], Original Author

Changelog

1.1 (2014-06-04)

  • Fixed z3c.form meta.zcml include [gborelli]
  • Restricted demo view to Manager role [gborelli]
  • Add placeholder attribute on single and multiple selection widgets [jslucas]

1.0b (2014-05-14)

  • Register categories and users search views to INavigationRoot [gborelli]
  • Add specific fields for single and multiple selection widgets [gborelli]
  • Improved IUserTokenInputWidget and UserSearch view [gborelli]
  • Package created using templer [gborelli]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for collective.select2, version 1.1
Filename, size File type Python version Upload date Hashes
Filename, size collective.select2-1.1.zip (52.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page