[matrix] form names

C.J. Adams-Collier cjac at colliertech.org
Sun Jan 24 22:18:44 CET 2010


Hey folks,

Could we get names on the forms?  I'm trying to fiddle with the matrix
using WWW::Mechanize and I'm having to select the form I want to submit
by index.  If another form is added prior to this one, the code will
break.  If there were name attributes on the forms, this would keep such
problems from happening...

Here, let me put a patch together...


        $ svn diff
        Index: customize/deffile.py
        ===================================================================
        --- customize/deffile.py	(revision 9613)
        +++ customize/deffile.py	(working copy)
        @@ -203,7 +203,7 @@
         HTML_postform = '</form>'
         
         HTML_uploadpreform = '''
        -<form action="matrix.cgi" method="post" enctype="multipart/form-data">
        +<form action="matrix.cgi" method="post" enctype="multipart/form-data" name="choices_form">
         '''
         
         HTML_uploadpostform = '</form>'



Hurm... you might want to re-think using HTML_preform as it is
currently.  It will be difficult to modify the opening form tag this
way.  I would recommend using printf-style string interpolation.

In fact, a templating system like mako or django would probably be a
better fit, but will require quite a bit of re-factoring.

Cheers,

C.J.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.delph-in.net/archives/matrix/attachments/20100124/21ae9e0b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: matrix_patch.diff
Type: text/x-patch
Size: 469 bytes
Desc: not available
URL: <http://lists.delph-in.net/archives/matrix/attachments/20100124/21ae9e0b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.delph-in.net/archives/matrix/attachments/20100124/21ae9e0b/attachment.sig>


More information about the matrix mailing list