Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 4846:3e36a3bc0335
issue2550822: Fix showing more than one additional property in class menu
Report and patch provided by James Mack:
| I had the following option in one of my templates:
| tal:content="structure python:context.propname.menu(additional=
| ['propname1', 'propname2'])"
|
| I expected this to display both propname1 and propname2 in the menu. It
| only displayed propname2.
| author | Thomas Arendsen Hein <thomas@intevation.de> |
|---|---|
| date | Wed, 13 Nov 2013 11:12:21 +0100 |
| parents | 1e4c45a4254b |
| children | 843886af0ea1 |
comparison
equal
deleted
inserted
replaced
| 4845:110ac45875ab | 4846:3e36a3bc0335 |
|---|---|
| 2046 for propname in additional: | 2046 for propname in additional: |
| 2047 prop = props[propname] | 2047 prop = props[propname] |
| 2048 if isinstance(prop, hyperdb.Link): | 2048 if isinstance(prop, hyperdb.Link): |
| 2049 cl = self._db.getclass(prop.classname) | 2049 cl = self._db.getclass(prop.classname) |
| 2050 labelprop = cl.labelprop() | 2050 labelprop = cl.labelprop() |
| 2051 fn = lambda optionid: cl.get(linkcl.get(optionid, | 2051 fn = lambda optionid, propname=propname, labelprop=labelprop: cl.get(linkcl.get(optionid, |
| 2052 propname), | 2052 propname), |
| 2053 labelprop) | 2053 labelprop) |
| 2054 else: | 2054 else: |
| 2055 fn = lambda optionid: linkcl.get(optionid, propname) | 2055 fn = lambda optionid, propname=propname: linkcl.get(optionid, propname) |
| 2056 additional_fns.append(fn) | 2056 additional_fns.append(fn) |
| 2057 | 2057 |
| 2058 for optionid in options: | 2058 for optionid in options: |
| 2059 # get the option value, and if it's None use an empty string | 2059 # get the option value, and if it's None use an empty string |
| 2060 option = linkcl.get(optionid, k) or '' | 2060 option = linkcl.get(optionid, k) or '' |
| 2061 | 2061 |
