Roundup Tracker - Issues

Issue 2550582

classification
keyword arg 'filterspec' does not work for menu
Type: behavior Severity: major
Components: Web interface Versions: 1.4
process
Status: closed
:
: : etaum, richard
Priority: : patch

Created on 2009-08-31 11:53 by etaum, last changed 2010-02-02 05:23 by richard.

Files
File name Uploaded Description Edit Remove
rdbms_common.patch etaum, 2009-08-31 11:53 patch file
Messages
msg3862 Author: [hidden] (etaum) Date: 2009-08-31 11:53
observed in roundup versions 1.4.4 and higher

using a construct like 

tal:content="structure
python:context.assignedto.menu(filterspec={'user_projects':
path('context/project/id')})"

does not work; we end up with an exception like this:

  File "/usr/lib/python2.6/dist-packages/roundup/cgi/client.py", line
959, in renderContext
    result = pt.render(self, None, None, **args)
  File "/usr/lib/python2.6/dist-packages/roundup/cgi/templating.py",
line 327, in render
    getEngine().getContext(c), output, tal=1, strictinsert=0)()
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 192, in __call__
    self.interpret(self.program)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 236, in interpret
    handlers[opcode](self, args)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 666, in do_useMacro
    self.interpret(macro)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 236, in interpret
    handlers[opcode](self, args)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 411, in do_optTag_tal
    self.do_optTag(stuff)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 396, in do_optTag
    return self.no_tag(start, program)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 391, in no_tag
    self.interpret(program)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 236, in interpret
    handlers[opcode](self, args)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 689, in do_defineSlot
    self.interpret(slot)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 236, in interpret
    handlers[opcode](self, args)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 632, in do_condition
    self.interpret(block)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 236, in interpret
    handlers[opcode](self, args)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/TAL/TALInterpreter.py",
line 564, in do_insertStructure_tal
    structure = self.engine.evaluateStructure(expr)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/PageTemplates/TALES.py",
line 227, in evaluate
    return expression(self)
  File
"/usr/lib/python2.6/dist-packages/roundup/cgi/PageTemplates/PythonExpr.py",
line 69, in __call__
    return f()
  File "<string>", line 2, in f
  File "/usr/lib/python2.6/dist-packages/roundup/cgi/templating.py",
line 1940, in menu
    for opt in linkcl.filter(None, conditions, sort_on, (None, None))
  File
"/usr/lib/python2.6/dist-packages/roundup/backends/rdbms_common.py",
line 2174, in filter
    proptree = self._proptree(filterspec, sortattr)
  File "/usr/lib/python2.6/dist-packages/roundup/hyperdb.py", line 1057,
in _proptree
    p = p.append(k)
  File "/usr/lib/python2.6/dist-packages/roundup/hyperdb.py", line 345,
in append
    propclass = self.props[name]
KeyError: 'filterspec'


I append a patch the implements a rought and ready workaround for this
problem ...
msg4016 Author: [hidden] (richard) Date: 2010-02-02 05:23
The correct usage of menu() is:

python:context.assignedto.menu(user_projects=path('context/project/id'))

ie. the additional keyword arguments are used as the filterspec.
History
Date User Action Args
2010-02-02 05:23:29richardsetstatus: new -> closed
nosy: + richard
messages: + msg4016
2009-08-31 11:53:12etaumcreate