[Python-checkins] python/dist/src/Doc/lib libcgi.tex, 1.40.10.3, 1.40.10.4

akuchling at users.sourceforge.net akuchling at users.sourceforge.net
Sun Jun 6 19:29:07 EDT 2004


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

Modified Files:
      Tag: release23-maint
	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.40.10.3
retrieving revision 1.40.10.4
diff -C2 -d -r1.40.10.3 -r1.40.10.4
*** libcgi.tex	23 Jan 2004 04:08:14 -0000	1.40.10.3
--- libcgi.tex	6 Jun 2004 23:29:05 -0000	1.40.10.4
***************
*** 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