Skip to content

Commit

Permalink
Docs: rework CursorPage example
Browse files Browse the repository at this point in the history
  • Loading branch information
lafrech committed Mar 11, 2024
1 parent 43bd8fe commit 56036a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"werkzeug": ("https://werkzeug.palletsprojects.com/", None),
"flask": ("https://flask.palletsprojects.com/", None),
"sqlalchemy": ("https://docs.sqlalchemy.org/en/latest/", None),
"mongoengine": ("https://docs.mongoengine.org/", None),
}

issues_github_path = "marshmallow-code/flask-smorest"
Expand Down
7 changes: 3 additions & 4 deletions docs/pagination.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ for `list`-like objects: :class:`Page <Page>`. For other types, a custom pager
may have to be defined.

For instance, the following custom pager works with cursor classes that support
slicing and provide a ``count`` method returning the total number of element.
This include SQLAlchemy's :class:`Query <sqlalchemy.orm.query.Query>`,
Mongoengine's :class:`QuerySet <mongoengine.queryset.QuerySet>`,...
slicing and provide a ``count`` method returning the total number of elements,
such as SQLAlchemy's :class:`Query <sqlalchemy.orm.query.Query>`.


.. code-block:: python
Expand All @@ -87,7 +86,7 @@ Mongoengine's :class:`QuerySet <mongoengine.queryset.QuerySet>`,...
@blp.response(200, PetSchema(many=True))
@blp.paginate(CursorPage)
def get(self):
return Pet.get()
return db.session.query(Pet)
Pagination Parameters
---------------------
Expand Down

0 comments on commit 56036a5

Please sign in to comment.