Personal tools
You are here: Home Feeds All Howtos and Tutorials

All Howtos and Tutorials

All Grok howtos and tutorials.

Repeatability and deployment issues
Repeating a buildout from a version of a configuraiton, and deployment issues to resolve
Source, Binary and RPM experiments
Distributing your buildout as source or binary, experiments with the RPM format
zc.sharing example
A small example of the "system assembly" use case. We define a Zope 3 instance, and a test script.
Buildout command line, default settings and extending configurations
Using the command-line, operating modes, default settings and extending configurations
Exercise 3
Write recipe that creates a file from source given in a configuration option.
Writing your own recipes
Use the zc.buildout recipe API
Building custom eggs
Custom egg builds such as a distribution with compiled files
Excercise 2
Add a custom interpreter to the zope.event from excercise 1
Recipes to install eggs, scripts and custom interpreters
Commonly used recipes
Accessing Zope3 standard macros
The standard macros of Zope 3, which render also the default ZMI pages, are accessible under the view-name standard_macros and usually provide slots title, headers and body. It is good style to provide this slots with your homegrown views as well.
Creating Objects Based on Form Input
What if we wanted the user to be able to designate which Natural object was instantiated for display on this web page?
The Natural class implementation
Now we merely have to provide an implementation for our Natural class.
Our Topic: The Natural Numbers
To make this tutorial simple, we will build a small web site that lets the user visit what some people call the natural numbers: the integers beginning with 1 and continuing with 2, 3, 4, and so forth. We will define a Natural class which knows a few simple things about each number - like which number comes before it, which comes after it, and what its prime factors are.
Introduction
Why instantiate objects from external data sources?
Defining Permissions and restricting access
As all Views in Grok default to public access, anyone can use the ViewContact view. If you want to restrict access to a view, you have to explicitly protect it with a permission.
Setup Code
Imagine a Grok module for holding Contact Info called contact.py. By default, anyone is able to view the ViewContact view.
Writing Your Own Container
The above approach, using Traversers, gives Grok just enough information to let users visit your objects, and for you to assign URLs to them.
Providing Links To Other Objects
What if the object you are wrapping can return other objects to which the user might want to navigate?
Custom Traversers
But what about situations where you want each of your transient objects to have its own URL on your site?
Having Your View Directly Instantiate An Object
We now reach the first of our four techniques!
Document Actions