[z3-five] zc.table sorting

Dennis Schulz D.Schulz81 at gmx.net
Tue Nov 14 17:49:22 CET 2006


Hi,
I have tried to sort my columns by the following code that I found in various examples around:

columns = [
    GetterColumn(name=u'name', title=u'Full Name', getter=lambda i, f: '<a href="tableview.html?display=view&id=%s">%s</a>' % (quote(i.name), i.name), subsort=True),
    GetterColumn(name=u'description', title=u'Full Description', getter=lambda i, f: i.description, subsort=True),
    GetterColumn(name=u'purchasingclass', title=u'Purchasing Class', getter=lambda i, f: i.purchasingClass.name, subsort=True)
    ]

for c in columns:
    directlyProvides(c, zc.table.interfaces.ISortableColumn)


I get the following error and traceback:
( I use Zope 2.9.5, Plone 2.5.1, Five 1.4.1, zc.table 0.6 py 2.4.egg,
are there any proves that zc.table sorting works with this zope version??)


Error Type
    ComponentLookupError
Error Message
    (, , 'zc.table')

2006-11-14 17:38:25 ERROR Zope.SiteErrorLog http://localhost:8080/dennis/applications/purchaserequisition.2006-11-07.5098603683/tableview.html
Traceback (innermost last):
  Module ZPublisher.Publish, line 115, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 41, in call_object
  Module zope.formlib.form, line 757, in __call__
  Module Products.Five.formlib.formbase, line 46, in update
  Module plone.app.form._patches, line 53, in update
  Module zope.formlib.form, line 738, in update
  Module zope.formlib.form, line 582, in success
  Module Products.PurchaseRequisition.browser.purchaseRequisition, line 90, in handle_search_action
  Module Shared.DC.Scripts.Bindings, line 311, in __call__
  Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
  Module Products.PageTemplates.PageTemplateFile, line 113, in _exec
  Module Products.PageTemplates.PageTemplate, line 104, in pt_render
   - <ImplicitAcquirerWrapper object at 0x05A3D890>
  Module TAL.TALInterpreter, line 238, in __call__
  Module TAL.TALInterpreter, line 281, in interpret
  Module TAL.TALInterpreter, line 749, in do_useMacro
  Module TAL.TALInterpreter, line 281, in interpret
  Module TAL.TALInterpreter, line 457, in do_optTag_tal
  Module TAL.TALInterpreter, line 442, in do_optTag
  Module TAL.TALInterpreter, line 437, in no_tag
  Module TAL.TALInterpreter, line 281, in interpret
  Module TAL.TALInterpreter, line 780, in do_defineSlot
  Module TAL.TALInterpreter, line 281, in interpret
  Module TAL.TALInterpreter, line 457, in do_optTag_tal
  Module TAL.TALInterpreter, line 442, in do_optTag
  Module TAL.TALInterpreter, line 437, in no_tag
  Module TAL.TALInterpreter, line 281, in interpret
  Module TAL.TALInterpreter, line 728, in do_defineMacro
  Module TAL.TALInterpreter, line 281, in interpret
  Module TAL.TALInterpreter, line 772, in do_defineSlot
  Module TAL.TALInterpreter, line 281, in interpret
  Module TAL.TALInterpreter, line 728, in do_defineMacro
  Module TAL.TALInterpreter, line 281, in interpret
  Module TAL.TALInterpreter, line 647, in do_insertStructure_tal
  Module Products.PageTemplates.TALES, line 221, in evaluate
   - URL: pagetable
   - Line 9, Column 2
   - Expression: standard:'view/table'
   - Names:
      {'container': <PurchaseRequisition at /dennis/applications/purchaserequisition.2006-11-07.5098603683>,
       'context': <PurchaseRequisition at /dennis/applications/purchaserequisition.2006-11-07.5098603683>,
       'default': <Products.PageTemplates.TALES.Default instance at 0x017F4328>,
       'here': <PurchaseRequisition at /dennis/applications/purchaserequisition.2006-11-07.5098603683>,
       'loop': <Products.PageTemplates.TALES.SafeMapping object at 0x05A2D918>,
       'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x017E1878>,
       'nothing': None,
       'options': {'args': ()},
       'repeat': <Products.PageTemplates.TALES.SafeMapping object at 0x05A2D918>,
       'request': <HTTPRequ[2006-11-14 17:38:26,282] [engine]: ROLLBACK
[2006-11-14 17:38:26,282] [engine]: ROLLBACK
est, URL=http://localhost:8080/dennis/applications/purchaserequisition.2006-11-07.5098603683/tableview.html>,
       'root': <Application at >,
       'template': <ImplicitAcquirerWrapper object at 0x05A3D890>,
       'traverse_subpath': [],
       'user': <PropertiedUser 'mugdiman'>,
       'view': <Products.Five.metaclass.purchaseRequisitionSearchForm object at 0x055B1290>,
       'views': <zope.app.pagetemplate.viewpagetemplatefile.ViewMapper object at 0x05A3DC10>}
  Module Products.PageTemplates.Expressions, line 185, in __call__
  Module Products.PageTemplates.Expressions, line 180, in _eval
  Module Products.PageTemplates.Expressions, line 85, in render
  Module zc.table.table, line 66, in __call__
  Module zc.table.table, line 75, in renderContents
  Module zc.table.table, line 80, in renderHeaderRow
  Module zc.table.table, line 84, in renderHeaders
  Module zc.table.table, line 88, in renderHeader
  Module zc.table.table, line 349, in getHeader
  Module zc.table.table, line 354, in _addSortUi
  Module zope.component, line 141, in getAdapter
ComponentLookupError: (<HTTPRequest, URL=http://localhost:8080/dennis/applications/purchaserequisition.2006-11-07.5098603683/tableview.html>, <InterfaceClass zope.interface.Interface>, 'zc.table')

-- 
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!


More information about the z3-five mailing list