# HG changeset patch # User Paul Boddie # Date 1355092593 -3600 # Node ID 9b61c62713fc59ab7872b7379166b61e494e17f4 # Parent 714fe9fe846dd9b56a972ccb162be5f40294153a Added a default for the action and usage of the fragment identifier in the form tag. diff -r 714fe9fe846d -r 9b61c62713fc MoinForms.py --- a/MoinForms.py Fri Dec 07 01:05:58 2012 +0100 +++ b/MoinForms.py Sun Dec 09 23:36:33 2012 +0100 @@ -641,15 +641,18 @@ queryparams = [] - for argname in ["fragment", "action"]: + for argname, default in [("fragment", None), ("action", "MoinFormHandlerAction")]: if attrs and attrs.has_key(argname): queryparams.append("%s=%s" % (argname, attrs[argname])) + elif default: + queryparams.append("%s=%s" % (argname, default)) querystr = "&".join(queryparams) - write(fmt.rawHTML('
' % - escattr(page.url(request, querystr)) - )) + write(fmt.rawHTML('' % ( + escattr(page.url(request, querystr)), + attrs.has_key("fragment") and (' id="%s"' % attrs["fragment"]) or "" + ))) # Obtain page text for the form, incorporating subregions and applicable # sections.