Project description

Grok

What is grok?

Grok uses the Component Architecture and builds on Zope concepts like
content objects (models), views, and adapters. Its simplicity lies in
using convention over configuration and sensible defaults when
wiring components together. That means neither a configuration
language like ZCML nor a lot of repetition are needed to create a web
application with grok.

Who is grok?

Grok is a friendly caveman from the Stone Age. He has a big club that
he hunts mammoths with. He will also use this club to smash anything
he doesn’t like.

“ME GROK SMASH ZCML!”

Getting grok

The easiest way to get started with grok is to install the
grokproject package
(e.g. via easy_install grokproject) and then create a new project
area by calling the grokproject script like so:

$ grokproject MyProject
... many lines of output here

This will create a project area in MyProject as well as download
and install grok.

You can also get grok from the subversion repository:

svn co svn://svn.zope.org/repos/main/grok/trunk grok

Then follow the instructions of INSTALL.txt.

Grok changes

1.10.1 (2012-05-02)

Update version requirements.

1.10 (2012-05-02)

Split off the Application component and the local_utility directive to
grokcore.site. A backwards compatibility import for Application is left
in place.

Split off the catalog and indexing components from grok into
grokcore.catalog.

The permissions() directive, the Permission component and the Role
component moved from grok to grokcore.security. The grok package imports
these component, so they can still be accessed through the grok api.

1.9 (2011-09-06)

Added imports for querySubscriptions(), queryMultiSubscriptions(),
queryOrderedSubscriptions() and queryOrderedMultiSubscriptions() functions
that complement the Subscriptions and MultiSubscriptions components.

1.8 (2011-07-14)

Incorporate grokcore.chameleon and have it configured by default.

Expose the Layout, Page, AddFormPage, EditFormPage, DisplayFormPage and
FormPage components that are brought by grokcore.layout. The grok variants
mixin application_url() and flash() functionality typically found in grok’s
viewish components.

Expose the ExecptionPage, NotFoundPage and UnauthorizedPage component from
grokcore.layout.

Expose the ContentProvider component from grokcore.view

Declare the name “index” as default view name for error views.

1.7 (2011-05-26)

Directly depend on zope.app.wsgi and configure it too to have the useful
IResult adapters for (temporary) files registered.

Import grokcore.component.global_adapter too.

1.6 (2011-04-04)

Fix tests that relied on older versions of zope.testbrowser.

Added grok.index.Value component.

1.5 (2011-02-14)

Added import for Subscription and MultiSubscription components.

1.4.3 (2011-02-08)

Fix tests now that error views no longer by default provide ISystemErrorView.

1.4.2 (2011-01-20)

Should’ve listed IApplication as part of the grok API too.

1.4.1 (2011-01-20)

Grok should still provide IApplication in the grok API, even now that it
got moved to grokcore.site.interfaces.

Moved the XMLRPC, REST component into separate packages
grokcore.xmlrpc and grokcore.rest. Consequently the custom traverse
components that Grok defined were moved to grokcore.traverser. Grok
the-python-package acts more and more like an import-hub.

To build the docs we now use collective.recipe.sphinxbuilder
instead of our own, early hack (get rid of grokdocs
subpackage). Buildout now generates grokdocs2html and
grokdocs2pdf which should do what you think they do.

The IApplication interface, and getApplication() moved to
grokcore.site.

1.3 (2010-11-03)

The IGrokSecurityView interface has been to grokcore.view.

The make_checker util function has been moved to grokcore.view.

The base publisher has been moved to grokcore.view as an
optional feature : security_publication.

The JSON component and grokker are now moved to
grokcore.json. Grok now depends on this new grokore package.

Update to latest martian and grokcore.component.

1.2.1 (2010-10-26)

Grok tutorial example projects updated.

Documentation updates in preparation for the Grok Toolkit 1.2 release.

Use zc.buildout-1.5.2.

1.2 (2010-10-13)

No changes were necessary.

1.2a (2010-10-07)

Grok and the Grok Toolkit now use zc.buildout-1.5.1 that should simplify
Grok’s installation story significantly. It is now possible to use a system
Python installation for installing Grok. This obsoletes the virtualenv
requirement.

Grok and the Grok Toolkit will use the ZTK-1.0 release. Note though that
several package versions are overridden to include bugfix releases.

Various dependencies have been updated.

Removed z3c.testsetup-specific test collector from grok.testing. You can
still use z3c.testsetup with grok, but have to declare the dependency in your
project’s setup.py explicitly.

The grok.View component now uses the grokcore.message package for its
flash method.

Grok test zcml now explicitly sets a defaultView name (to index.html).
This has been added since we no longer depend on packages such as
zope.app.zcmlfiles, that used to take care of that configuration step.

Internationalization of title and description of roles are not lost anymore.

create_application now raises a KeyError, in cases of key duplication,
to match the zope.container behavior. Tests have been adapted accordingly.

Added KeyError error handling to the existing DuplicationError, to fit
the zope.container changes. Tests have been adapted accordingly.

1.1.1 (2010-05-30)

Make use of the groktoolkit 1.1.1 that includes several bugfix releases
of Grok’s dependencies such as:

zope.password, where the SSHAPasswordManager was fixed.

zope.publisher, that fixes the long standing XML-RPC “hanging” bug.

Cleanups in the buildout parts.

Remove zope.app.twisted.

1.1 (2010-05-18)

Add zope.pluggablauth as a dependency.

1.1rc1 (2010-02-25)

Now using grokcore.content for the base content types : Model,
Container and OrderedContainer.

Lifted the dependency on zope.app.authentication and depend on
zope.password instead.

Lifted dependencies on deprecate packages zope.app.error and
zope.app.securitypolicy and zope.app.session.

Beside these changes lot of work has been undertaken to remove as much
dependencies on “older” zope.app.* packages as possible from Grok itself
and from the dependencies of Grok. This work is not complete yet.

1.1a2 (2009-12-22)

Updated z3c.recipe.compattest’s version and used it for a bin/compattest
that tests grok and all its dependencies.

1.1a1 (2009-11-17)

This release depends on grokcore.view 1.13a1.

Add ZTK support (currently ZTK 1.0dev).

Grokdocs now uses ZTK pinned versions.

The grok.permissions(), that is used in the grok.Role component now
accepts references to grok.Permission class, not just permission ids.
This behaviour is now symetrical to the grok.require() directive.

Added an util function, create_application, to create an
application and trigger the correct events during the process.

Grok now provides an application-centric event to complete the
zope.lifecycle ones. This event, ApplicationInitializedEvent, is
destined to be trigged after the application has been added to a
container. At this particular step, the application is considered
safe for additional content to be created.

Use grokcore.site and grokcore.annotation instead of builtins
implementations.

Update the reference to mention zope.View.

Update the reference to mention direct references to permissions in
grok.require and grok.permissions in grok.Role.

Fix documentation bug where virtualenv wasn’t explained correctly.

Remove the grok.View permission declaration in etc/site.zcml.in,
should have gone in 1.0b2 already

1.0b2 (2009-09-17)

See: upgrade_notes_1.0b2 for special notes on upgrading to this release.

Revert back to an older version of grokui.admin that has not seen any
changes related to the grok.View permission and the
View/CodeView split and still has the introspector that is removed
from newer versions.

grokcore.view, grokcore.viewlet and grokcore.formlib and
Grok itself have been updated to undo the View/CodeView
split that we had temporarily introduced in the development versions
after Grok 1.0a4. This means the behavior of grok.View is
unchanged from Grok 1.0a4. Nothing to see here!

Changed the default permission to zope.View instead of
zope.Public. This means a modification needs to be made to your
site.zcml if you’re upgrading an existing Grok-based
project. See the upgrade notes for more information.

1.0a1 (2009-01-08)

See: upgrade_notes_1.0a1 for special notes on upgrading to this release.

Feature changes

Introduced grok.interfaces.IGrokSecurityView, a marker interface
which non-Grok views can use to state that they want to be handled
like regular Grok views by the Grok publisher.

Expose the DirectoryResource component from grokcore.view and the
accompanying path directive.

Similar to the layers and skins restructuring, the grok.RESTProtocol
baseclass has been removed in favour of a grok.restskin(name) directive
that can be used on REST layer interfaces. Introduced the IRESTLayer base
interfaces for defining REST layers.

Besides our extensive existing documentation, we have also started
to add a lot of docstrings to the Grok source code so it becomes
easier to understand.

Bug fixes

Have GrokForm define an empty actions attribute by default, in order
for “action-less” forms to work easily.

Restructuring

The grok.admin subpackage has been factored out to a separate
package grokui.admin. To have the Grok admin UI available in
your environment, add grokui.admin to the required packages in
the setup.py of your package.

Removed grok.Skin baseclass in favour of a grok.skin(name)
directive that can be used on layer interfaces. Also removed the
IGrokLayer interface in favour of exposing IBrowserRequest
from the grok package.

Security-related directives and helpers have been moved out to a
grokcore.security package.

View-related base classes, directives and grokkers have been moved
out to a grokcore.view package.

Form-related base classes and helpers have been moved out to a
grokcore.formlib package.

Bug fixes

Replace zope.deprecation.tests.warn with grok.testing.warn to:

Make the signature identical to warnings.warn

To check for *.pyc and *.pyo files.

When zope.deprecation is fixed this warn() function can be removed again.
Makes all the tests pass under Python-2.5.

0.13 (2008-06-23)

See: upgrade_notes_0.13 for special notes on upgrading to this release.

Restructuring

The basic component base classes (Adapter, MultiAdapter,
GlobalUtility), their grokkers, as well as many of the basic
directives have been factored out to a reusable
grokcore.component package.

Ported directives to Martian’s new directive implementation. As a
result, many helper functions that were available from grok.util
were removed. The functionality is mostly available from the
directives themselves now.

Refactored class grokkers to make use of Martian’s new declarative
way for retrieving directive data from classes, and Martian’s new
declarative way to write grokkers. See upgrade_notes_0.13
for more information.

Feature changes

GrokTemplate sets up the namespaces for the template by calling
default_namespace() ``on the view component the template is
associated with. As a result, ``ViewletManagers and Viewlet
can now push in the viewletmanager and viewlet namespaces
into the template.

Updated tutorial section about grokproject to fit the latest changes.

Added grok.traversable directive for easy traversal to attributes and
methods.

grok.require() can refer to subclasses of grok.Permission
directly, instead of their id. This, for one, avoids making typos in
permission ids. Permission components do still need the
grok.name() directive for defining the permission’s id.

Added an optional parameter data to the method url() that
accepts a dictionary that is then converted to a query string. See

There is now a new IContext interface available. If you make
your class implement that interface, it (and its subclasses) will be
candidates for being a context in a module (for automatic context
lookup if grok.context is not present). This relies on a feature
introduced in grokcore.component 1.1.

grok.Model implements grok.interfaces.IContext now (which is
imported from grokcore.component). grok.Container now
implements grok.interfaces.IContainer. Traversers and default
views have been set up for these interfaces, so that new
implementations that function as a model or container can be easily
created. Just use grok.implements(IContainer) or
grok.implements(IContext). This is useful for Grok extensions
that want to implement new content classes.

Version 2.1 of z3c.autoinclude contained code that caused Grok to
fail to start on some platforms if the system-supplied Python was
used (at least on some versions of Ubuntu and Debian). Now include
version 2.2 of z3c.autoinclude which should fix this problem. This
fix was also made on Grok 0.12 in its online versions list after
release.

Port fix of zope.formlib to correctly adapt the context to a FormField’s
interface, not the field.

0.12 (2008-04-22)

See: upgrade_notes_0.12 for special notes on upgrading to this release.

Feature changes

Add support for viewlets and viewlet managers, grok.Viewlet
and grok.ViewletManager.

Add a new directive, grok.order(), which can be used to help
sort components. At the time it is not used yet, but we intend to
use it for the viewlets support. Note that this means Grok now
requires Martian 0.9.3 or higher. See grok.interfaces for more
documentation on this directive.

Now depend on z3c.autoinclude. This allows the use of the
<includeDependencies package="."/> directive, which automatically loads
up ZCML needed for the dependencies listed in your project’s
setup.py. The new release of grokproject adds this line
automatically. Upgrade grokproject to make use of this
functionality in new projects:

$ easy_install -U grokproject

Classes that end with “-Base” are no longer implicitly considered base
classes. These classes need to have the grok.baseclass() directive added to
them explicitly.

See upgrade_notes_0.12 for more information.

Bug fixes

Do not register the publishTraverse and browserDefault methods of the
JSON component as views.

Methods with names that start with an ‘_’ are not registered as views
for XMLRPC, REST and JSON components.

Use a configuration action for the registration of the static directory.

Fix imports from zope.app.securitypolicy.

Grok does not raise a GrokError anymore when it finds unassociated
templates, but will issue a UserWarning.

Permission definitions received the wrong, too high, configure
action priority (not to be confused with grokker priority). In some
cases this caused permissions to be defined later than they were
used. Use a low action priority instead for permissions.

Restructuring

Refactor commonalities out of meta.py.

zope.app.securitypolicy is no longer used. zope.securitypolicy provides
all securitypolicy features used by Grok.

0.11 (2007-11-08)

See: upgrade_notes_0.11 for special notes on upgrading to this release.

Feature changes

Integrated skins and layers: grok.layer, grok.IGrokLayer,
grok.Skin.

Grok now supports hooking in new template languages without much work.
See also doc/minitutorials/template-languages.txt. See Restructuring below
for more techinical info.

Accessing a template macro via context/@@the_view/the_template is now
deprecated for the standard ZPT story of using
context/@@the_view/macro/the_template.

There is now a grok.direct() directive that can be used on GlobalUtilities
to mark that the class provides the utility interface directly and need
no instantiation.

Removed grok.define_permission in favor of the
grok.Permission component base class. You should now subclass
this base class to define permissions. See also
doc/minitutorials/permissions.txt

Added the grok.Role component base class to define roles.

The admin UI now displays and offers deletion of broken objects.

Removed support for defining model schemas using an inner class with
the special name fields. This was abandoned in favor the usual
Zope 3 way of defining schemas in interfaces and implementing them
in our Grok models.

Restructuring

Grokkers now emit configuration actions, much like ZCML directive
handlers do. If you defined custom grokkers,
see upgrade_notes_0.11 for more information.

The new pluggable template language support includes some restructuring:

GrokPageTemplate is now split up into two. BaseTemplate, on which all
templates need to be based, and GrokTemplate, which also provides a
set of methods for easy integration of templating languages.

All objects based on GrokTemplate are now grokked, instead of having
separate grokkers for each type of template.

The View is now completely template-language agnostic, which makes it
easy to hook in new page template languages.

There are now new interfaces (ITemplate and ITemplateFileFactory)
used when you implement support for a new templating language.

Changed the way grok’s functional tests are set up. Instead of each
test case doing its own test setup, it is now done once by the
ftesting layer. This avoids ordering problems when some ftests
would influence the environment of other ftests that were run later
in time.

0.10.2 (2007-10-24)

Bug fixes

0.10.1 (2007-10-10)

Bug fixes

buildout.cfg extends versions.cfg to pin down the versions of the
dependency tree. This should avoid the situation where we release
Grok, some dependency changes, and Grok breaks as a result. In
conjunction with this we will also be releasing a new version of
grokproject that will use this version infrastructure by default.