[Grok-dev] Using z3c.table in a grok view?

Adam Summers adamsummers1 at mac.com
Sun Jun 1 09:46:14 EDT 2008


Hi there,

I'm trying to get a better feel for grok so that I  can evaluate for  
an upcoming project - so far, its been a relatively painless experience!

However, I've been using Paul Carduner's guide to the z3c packages (http://carduner.net/docs/z3c-tutorial/ 
) and thought I would try out using z3c.table, and have hit a  
stumbling block

I have a view, thus:

class Index(grok.View):
         grok.context(gehar)

         def __init__(self, context, request):
                 super(Index, self).__init__(context, request)
                 self.tableView = table.Table(context, request)

(note I can't have Index inherit z3c.table.Table, as Table's render()  
method causes conflicts with my index.pt)
and in my corresponding index.pt I can have the following:

<p> Here is the table from z3c.table </p>
   <div tal:replace="structure python:view.tableView.renderTable()" />


So far, so good -- no table gets displayed though, as I haven't  
registered columns as named multiadapters. This is where things go  
pear shaped.

I have in my code the following -- can someone see what I'm doing wrong?

from z3c.table import table, column

class NameColumn(column.GetAttrColumn, grok.MultiAdapter):
         grok.name('nameCol')
         grok.adapts(table.interfaces.ITable)
         grok.provides(table.interfaces.IColumn)
         header = u'Name'
         attrname = 'who'
         weight = 1

Once I get an answer, I can write it up as a howto.

Thanks in advance for any help :)
Regards,
Adam

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/grok-dev/attachments/20080601/2bf00b43/attachment-0001.html


More information about the Grok-dev mailing list