[Zope-DB] passing a variable to zsql method

Laura McCord Laura.McCord at doucet-austin.com
Fri Sep 3 12:32:42 EDT 2004


if I have a zsql method that looks like this:

Select * from host 
Order By ....

And I call the zsql method like this:
...here/resultTable(User) or
...here/resultTable(Model) or 
...here/resultTable(Serial)

How do I modify my zsql method to accept any of these parameters and
replace the Order By so if I call here/resultTable(User), it will order
by User? Or, if I call the method as here/resultTable(Model), it will
order by Model?

I guess I was just checking to see if this is possible or do I have to
have a separate method for each sort.

Thanks.



More information about the Zope-DB mailing list