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.

pypm install p2.container

How to install p2.container

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install p2.container
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1 Available View build log
Windows (64-bit)
0.1 Available View build log
Mac OS X (10.5+)
0.1 Available View build log
Linux (32-bit)
0.1 Available View build log
Linux (64-bit)
0.1 Available View build log
Lastest release
version 0.1 on Feb 20th, 2011

Tests for the participation aware container


Let's first create an a grok.Container with two grok.Model items in it. >>> from p2.container.container import ParticipationAwareContainer >>> from grok import Model, Container >>> item1 = Model(); item1.title = "item1" >>> item2 = Model(); item2.title = "item2" >>> cont = Container() >>> cont['item1'] = item1 >>> cont['item2'] = item2

Now we adapt it to IParticipationAwareContainer to make it security aware. >>> from p2.container.interfaces import IParticipationAwareContainer

Check enumeration behaviour of the participation aware container. First with no security constraints in place. >>> # participationAwareContainer seems a too long word.. >>> p25r = IParticipationAwareContainer(cont) >>> for key in p25r: ... print key ... item1 item2

>>> [value for value in p25r.values()]
[<grokcore.content.components.Model object at 0x...>, <grokcore.content.components.Model object at 0x...>]
>>> [value for value in p25r.keys()]
[u'item1', u'item2']
>>> for key, value in p25r.items():
...     print "%s:%s" % (key, value)
item1:<grokcore.content.components.Model object at 0x...>
item2:<grokcore.content.components.Model object at 0x...>
>>> len(p25r)


0.1 - Unreleased
  • Initial release

Subscribe to package updates

Last updated Feb 20th, 2011

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.