[Python-checkins] python/dist/src/Doc/lib libcgi.tex,1.43,1.44

akuchling at users.sourceforge.net akuchling at users.sourceforge.net
Sun Jun 6 19:28:25 EDT 2004


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25154

Modified Files:
	libcgi.tex 
Log Message:
[Bug #953177] Mention .getlist(); text from Paul Moore

Index: libcgi.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcgi.tex,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** libcgi.tex	23 Jan 2004 04:05:27 -0000	1.43
--- libcgi.tex	6 Jun 2004 23:28:23 -0000	1.44
***************
*** 136,152 ****
  If you expect this possibility
  (when your HTML form contains multiple fields with the same name), use
! the \function{isinstance()} built-in function to determine whether you
! have a single instance or a list of instances.  For example, this
  code concatenates any number of username fields, separated by
  commas:
  
  \begin{verbatim}
! value = form.getvalue("username", "")
! if isinstance(value, list):
!     # Multiple username fields specified
!     usernames = ",".join(value)
! else:
!     # Single or no username field specified
!     usernames = value
  \end{verbatim}
  
--- 136,147 ----
  If you expect this possibility
  (when your HTML form contains multiple fields with the same name), use
! the \function{getlist()} function, which always returns a list of values (so that you
! do not need to special-case the single item case).  For example, this
  code concatenates any number of username fields, separated by
  commas:
  
  \begin{verbatim}
! value = form.getlist("username")
! usernames = ",".join(value)
  \end{verbatim}
  




More information about the Python-checkins mailing list