There are two ways to access objects through Z SQL Methods. Objects can be accessed by iterating over the results of calling Z SQL Methods.
For database methods that are intended for returning individual records, objects may be accessed directly through URL traversal. Consider the lookup_part query in figure . This method takes a single argument, a part number, and returns the corresponding part. A URL can be used to access a specific part by adding the input argument name, part_number and a specific part number to the URL for the database method. For example, to look up part number fdax , a URL like:
http://plutonia.com/Plutonia/Computer/lookup_part/part_number/fdax
Might be used. Normally, record objects don't provide a default interface, so it will be necessary to invoke a method ob the object, as in:
http://plutonia.com/Plutonia/Computer/lookup_part/part_number/fdax/orders
This example uses the method orders on a part number. This method could be defined in a class specified in the Z SQL Method Advanced view, or it could be a method that is acquired from the Zope environment.
Previous Chapter | Up | Next Section | Contents