Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add compatibility layer to move to flask>=3 #55

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion invenio_jobs/services/results.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2024 CERN.
# Copyright (C) 2024 Graz University of Technology.
#
# Invenio-Jobs is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -9,13 +10,19 @@

from collections.abc import Iterable, Sized

from flask_sqlalchemy import Pagination
from invenio_records_resources.services.records.results import (
ExpandableField,
RecordItem,
RecordList,
)

try:
# flask_sqlalchemy<3.0.0
from flask_sqlalchemy import Pagination
except ImportError:
# flask_sqlalchemy>=3.0.0
from flask_sqlalchemy.pagination import Pagination


class Item(RecordItem):
"""Single item result."""
Expand Down