Add fetch_if, related documention and refactor code slightly.
This commit is contained in:
12
README.md
12
README.md
@@ -64,7 +64,11 @@ to check if it exists.)
|
||||
Student(student_id=10, student_name='Albert Einstein')
|
||||
```
|
||||
|
||||
Finally, we have two helper methods, `fetch_range(class_, range_)` and
|
||||
`fetch_all(class_)` the former fetches the records fetchable from the object
|
||||
id range provided by the user, whereas the latter fetches all records. Both
|
||||
return a tuple of `class_` objects.
|
||||
We have three helper methods, `fetch_range(class_, range_)` and
|
||||
`fetch_all(class_)` are very similar: the former fetches the records
|
||||
fetchable from the object id range provided by the user, whereas the
|
||||
latter fetches all records. Both return a tuple of `class_` objects.
|
||||
|
||||
The last helper method, `fetch_if(class_, condition)` fetches all
|
||||
the records of type `class_` that fit a certain condition. Here conditions
|
||||
must be written is SQL syntax.
|
||||
Reference in New Issue
Block a user