[Zope-dev] Z SQL: "optional" isn't?

Dieter Maurer dieter@handshake.de
Mon, 29 May 2000 21:56:33 +0200 (CEST)


Kyler B. Laird writes:
 > I'd like to build a Z SQL method for *many*
 > people to use to list courses that we offer.
 > I don't want to require that all queries
 > using it understand all of the columns, but
 > I do want to be able to modify the query in
 > many ways.
 > 
 > This works only if I provide at least an empty
 > string for all values.  If I don't provide a
 > value at all for one of the arguments, I get
 > 	Error, Bad Request: ['version'] 
You want to use "default values" in your SQL method argument list.

The details are described in "ZSQL/ZSQL.2.5.2.html".

You already got this advice. You failed, because you used
the wrong kind of quotes (i.e. single rather than double quotes).
Quote from "ZSQL2.5.2.html":

> See Database method input argument format: Argument name and type are
> separated by a colon. A equal sign separates the default value from
> the name and type. The default value is a string representation of the
> desired value. If the default value contains spaces, or is an empty
> string, then it must be surrounded by double quotes.)

> Pattern:    name:type="default"

Dieter