Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Datagrid for Archetypes content, rows based on z3c.form

Project Description


archetypes.gridfield adds support for data grids which are not inline editable. Rows are addable/editable using overlay window.

Please note, current version requires branch of which is included in the example buildout.

Additionally, gridfield widget is displayed on the base_view form only (field is not visible on the object edit form!!). This is not a bug but a feature.


Install as usuall. After that you can add additional field to you content type:

from archetypes.gridfield import GridField

    row_interface = IProjectRow


IProjectRow is a zope Interface which defines the data for one row. The addform and editform are generated from this one:

class IProjectRow(Interface):
    title   = schema.TextLine(title=u'Project name', required=True)
    kind    = schema.Choice(title=u'Project type',
    start_date = schema.Date(title=u'Start date', required=True)
    end_date   = schema.Date(title=u'End date', required=False)

You may define custom add/edit forms and update widgets:

from archetypes.gridfield.forms import AddForm, EditForm
from collective.z3cform.datetimewidget import DateFieldWidget

class ProjectAddForm(AddForm):
    def __init__(self, context, request):
        super(ProjectAddForm, self).__init__(context, request)
        self.fields['start_date'].widgetFactory = DateFieldWidget
        self.fields['end_date'].widgetFactory = DateFieldWidget

class ProjectEditForm(EditForm):
    def __init__(self, context, request):
        super(ProjectEditForm, self).__init__(context, request)
        self.fields['start_date'].widgetFactory = DateFieldWidget
        self.fields['end_date'].widgetFactory = DateFieldWidget

Since AddForm/EditForm is redefined, we must specify the forms in the field definition:

    row_interface = IProjectRow,
    add_form = ProjectAddForm,
    edit_form = ProjectEditForm,
    widget = GridWidget(label="Projects")


If you want to test archetypes.gridfield in separate buildout, checkout full package from SVN and use example.cfg buildout configuration:

svn co gridfield
cd gridfield
bin/buildout -c example.cfg
bin/instance fg

Finally visit base_view template of any object, eg. frontpage:

Usage in custom buildout

Please note, package is still in the development. Requires branch of and some custom version pins. Everything is set-up in example buildout so copy the requirements from it.


1.0dev (unreleased)

  • Initial release
Release History

Release History

This version
History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date (31.6 kB) Copy SHA256 Checksum SHA256 Source Mar 18, 2010

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting