ZTUtils.Zope make_hidden_input could preserve ordering
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zope 2 |
Invalid
|
Low
|
Unassigned |
Bug Description
Sometimes ordering of inputs on forms is important.
make_hidden_input method uses a dict which is by default unordered. If a dict like object was passed in that was ordered then make_hidden_input will reorder it which isn't desirable. The following code retains the existing order. Perhaps another way to retain order is to pass in an optional list of keys which specifies the order.
def make_hidden_
'''Redo ZTUtils.
if len(args) > 0:
d = args[0].copy()
for arg in args[1:]:
else:
d = {}
d.update(
hq = cgi.escape
qlist = complex_
for i in range(len(qlist)):
k, m, v = qlist[i]
qlist[i] = ('<input type="hidden" name="%s%s" value="%s">'
return '\n'.join(qlist)
Changed in zope2: | |
status: | New → Triaged |
tags: |
added: bugday removed: feature+solution zope |
The zope2 project on Launchpad has been archived at the request of the Zope developers (see https:/ /answers. launchpad. net/launchpad/ +question/ 683589 and https:/ /answers. launchpad. net/launchpad/ +question/ 685285). If this bug is still relevant, please refile it at https:/ /github. com/zopefoundat ion/zope2.