Personal tools
You are here: Home Documentation FAQ

FAQ

View entire FAQ in full Up to Table of Contents
This section addresses questions Grok developers frequently answer at the mailing list or IRC.

Learning guidance

What is a Grok directive?

A Grok directive is a class or module-level annotation that looks like this:

grok.foo('information')

If in a class, it annotates the class with extra information used to configure the class. If in a module, it annotates the module with this extra information. A module-level directive can be used as the default for all classes, if it can also occur in a class itself.

Directives are often optional; if they are left out the default value for that directive kicks in. The grok.require directive for example has as its default zope.Public, meaning views are public by default.

Grok directives are interpreted by a grokker.

What does someone mean when claiming that a component has been grokked?

It means that any relevant grokkers have acted on the component and the component has been configured.

What are the megrok packages about?

The packages that are under megrok namespace package are non-essential Grok packages that extend the basic functionality of Grok. Some of them integrate different Zope 3 packages into an easier to use Grok package which follows Grok conventions for sensible configuration.

What is a grokker?

A grokker is a component that configures a class, module or instance with Grok. It uses annotations made by directives to determine the details of this confirmation. Configuration often entails the registration of a class with the Zope Component Architecture (ZCA); an adapter is for instance registered with the ZCA by what it adapts and what interface it adapts to.

You don't need to learn how to write grokkers unless you want to extend Grok itself with new configuration behavior.

What are the grokcore packages?

These are packages that implement certain features in Grok itself. You don't need to deal with them unless you want to understand how Grok works internally, or if you want to use bits of Grok outside of Grok itself, for instance in a non-Grok Zope 3 application or in a Zope 2 setting.