Please note: this project is inactive since early 2006

4.5.2 Simple fetch

To fetch all the Writer objects, you simply write:


That's it.

Now what if you want the Writer objects whose last name is 'Hugo'? That's not really more complicated:

    objects=ec.fetch('Writer', qualifier='lastName=="Hugo"')

This is almost all you need to fetch any object from the database: just identify the type of the objects you're fetching, and the qualifier describing them. Everything is then done automatically, i.e. the correct SQL statement(s) are built and executed and the objects are then built from the retrieved rows and given back to you in a sequence.

In the next sections, we will see more complete examples, but it basically always this line that you'll use for fetching objects.

Comments are welcome: Sebastien Bigaret / Modeling Home Page
Hosted Logo