in case i have a user Model and article Model, user and article are one-to-many relation. so i can access article like this
user = session.query(User).filter(id=1).one()
print user.articles
but this will list user's all articles, what if i want to limit articles to 10 ? in rails there is an all()
method which can have limit / offset in it. in sqlalchemy there also is an all()
method, but take no params, how to achieve this?
Edit:
it seems user.articles[10:20]
is valid, but the sql didn't use 10 / 20 in queries. so in fact it will load all matched data, and filter in python?