Mercurial > p > roundup > code
diff roundup/cgi/templating.py @ 3909:e89bcb28f683
indexargs_url force ids to int
ids appear as hyperdb.String instances, which confused indexargs_url when they
appear in the filterspec. They need to be treated as treated as integers when
generating URLs.
It feels sort of hacky to check for 'id' like this but I'm at a loss for what
else to do in this case. Suggestions are welcome :)
Maybe we should look into using some other hyperdb class to represent ids?
this fixes [SF#783492]
Some trailing whitespace also got trimmed.
| author | Justus Pendleton <jpend@users.sourceforge.net> |
|---|---|
| date | Tue, 18 Sep 2007 16:59:42 +0000 |
| parents | 6733a7cce7f4 |
| children | 63d58cc1394a |
line wrap: on
line diff
--- a/roundup/cgi/templating.py Sun Sep 16 07:23:04 2007 +0000 +++ b/roundup/cgi/templating.py Tue Sep 18 16:59:42 2007 +0000 @@ -422,7 +422,7 @@ def input_html4(**attrs): """Generate an 'input' (html4) element with given attributes""" - _set_input_default_args(attrs) + _set_input_default_args(attrs) return '<input %s>'%' '.join(['%s="%s"'%(k,cgi.escape(str(v), True)) for k,v in attrs.items()]) @@ -2453,7 +2453,7 @@ if not args.has_key(k): if type(v) == type([]): prop = cls.get_transitive_prop(k) - if isinstance(prop, hyperdb.String): + if k != 'id' and isinstance(prop, hyperdb.String): l.append('%s=%s'%(k, '%20'.join([q(i) for i in v]))) else: l.append('%s=%s'%(k, ','.join([q(i) for i in v])))
