[Zope3-Users] Using z3c.table in a grok view?

Adam Summers adam at 4js.com.au
Sun Jun 1 10:28:51 EDT 2008


Hi, forgive the double posting. My membership to grok-dev hasn't been  
approved yet...


>
> 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
>


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope3-users/attachments/20080601/abf7c03f/attachment.html


More information about the Zope3-users mailing list