Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install plone.principalsource

How to install plone.principalsource

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install plone.principalsource
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0 Available View build log
1.0b1 Available View build log
Windows (64-bit)
1.0 Available View build log
1.0b1 Available View build log
Mac OS X (10.5+)
1.0b1
1.0Never BuiltWhy not?
1.0b1 Available View build log
Linux (32-bit)
1.0 Available View build log
1.0b1 Available View build log
Linux (64-bit)
1.0 Available View build log
1.0b1 Available View build log
 
Author
License
GPL
Lastest release
version 1.0 on Jun 8th, 2013

Introduction

This package provides a queriable sources (vocabularies) that return PAS users, groups or principals (both users and groups).

They are registered as named vocabularies, so you can do:

class IMyInterface(Interface):
    users = schema.Choice(title=u"Users",
                          vocabulary="plone.principalsource.Users")

    groups = schema.Choice(title=u"Groups",
                           vocabulary="plone.principalsource.Groups")

    principals = schema.Choice(title=u"Principals",
                               vocabulary="plone.principalsource.Principals")

The underlying source (see source.py) implements the IQuerySource interface from z3c.formwidget.query. This means that it can be used for a query-select widget, including the one in plone.formwidget.autocomplete.

A note about unicode

The source attempts to make it safe to do a __contains__ check, a getTerm() lookup, and searches using unicode strings. This is somewhat constrained by the underlying plugins. In particular, the standard ZODBGroups plugin is incapable of searching for groups with unicode titles or ids, and returns a list of all groups if passed a unicode string. As such, the source forces all unicode strings used to search for groups to UTF-8 (searching for users is unaffected).

Also, remember that tokens should be 7-bit ASCII strings. getTermByToken() is forgiving in that it silently encodes a unicode string to utf-8, but really you should only pass unicode to this method.

Changelog

1.0 - 2013-06-04
  • Fix compatibility with Plone 4.3. [davisagli]
1.0b1 - 2009-04-17
  • Initial release

Subscribe to package updates

Last updated Jun 8th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.