Personal tools
You are here: Home Documentation FAQ What is a Grok directive?

What is a Grok directive?

Up to Table of Contents

This FAQ applies to: Any version.

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.