Author: Lennart Regebro, Godefroid Chapelle



.. contents::


`five.grok` is a development layer for Zope 2, based on Grok framework

The development techniques are similar to the ones used with Grok

It is based on `grokcore` namespace packages that were factored out of Grok

Implemented features

Coming from Grok, the following components are available to Zope 2

- Zope 3 Component (Adapter, Global utilities, Subscribers),

- Permissions,

- Views and Viewlets,

- Skins and resources directories,

- Page Templates (using the Zope 2 Page Templates),

- Formlib forms (optional, you need to include the extra ``form``),

- Local sites and local utilities,

- Annotations,

- Layout (optional, you need to include the extra ``layout``).

All those components are available with exactly the same syntax than
in grok. You just have to do::

  from five import grok

Instead of::

  import grok


After adding the dependency to ``five.grok`` in your project, you have
to load the following ZCML::

  <include package="five.grok" />


And for this release we recommend to pin down the following version in
your buildout::

  five.formlib = 1.0.4
  five.localsitemanager = 2.0.5
  grokcore.annotation = 1.3
  grokcore.component = 2.5
  grokcore.formlib = 1.9
  grokcore.layout = 1.5.1 = 1.6.1 = 1.6.1
  grokcore.view = 2.7
  grokcore.viewlet = 1.10.1
  martian = 0.14

Zope 2.13 is required. If you wish to use a previous version of Zope
2, look at five.grok 1.0 for Zope 2.10.x or five.grok 1.2 for Zope 2.12.x.

More information

You can refer to the Grok website:, and the Grok

You can check the doctest included in sources as well.


1.3.2 (2012-08-17)

- Add an optional support for ``grokcore.layout``, with the extra

1.3.1 (2012-05-02)

- Make formlib support optional. This is not included by default. If
  you whish to use formlib, you need to include the extra ``form`` for
  ``five.grok``. Example:  ``five.grok [form] >= 1.3.1``.

- Fix the redirect method to properly work. Unlike in Zope 3, it
  doesn't support trusted.

1.3.0 (2011-11-07)

- Clean up code, update dependencies and tests, this release only
  works with Zope 2.13.  [thefunny42]

1.2.0 (2011-01-22)

- Require five.formlib for Zope 2.13 compatibility. This requires Zope 2.12.3
  or later.

1.1.2 (2010-08-04)

- Fixed problem with unrestrictedTraverse() and files in subfolders of grokked
  resource directories. This fix also depends on fixes in Zope 2.12.6 or

1.1.1 (2010-02-04)

- Fix namespace override in ZopeTwoPageTemplate, i.e. let users
  override 'view' for instance using the namespace method of a Grok
  view class. This bug was introduced in the 1.1 release.

1.1 (2009-11-16)

- Update code and tests to work with Zope 2.12. People using Zope 2.10
  and 2.11 should keep using five.grok 1.0.
  [thefunny42 and optilude]

- Update to martian 0.11.1, `grokcore.annotation`_ 1.1 and
  ``_ 1.1, `grokcore.view`_ to 1.12.2.

- Local utility implements IAttributeAnnotatable, IContext like in

1.0 (2009-09-17)

- Define an IFiveGrokAPI.

- Fix the broken ``url`` method on views.

- Reverted the CodeView base class, see grokcore.view changelog for
  more details.
  ``CodeView`` is still available as a backwards compatibility alias
  for ``View``. Please update all references to ``CodeView`` to

1.0b2 (2009-07-21)

- Added dependency on grokcore.view 1.9, grokcore.viewlet 1.1 and
  grokcore.formlib 1.2, and support for the new CodeView from grokcore.View.

1.0b1 (2009-06-30