Skip to content

Commit

Permalink
fix: add compatibility layer to move to flask>=3
Browse files Browse the repository at this point in the history
* flask-sqlalchemy moved pagination.

* this change has been added to have a smooth migration to flask>=3.0.0
  without creating a hard cut and major versions release.
  • Loading branch information
utnapischtim committed Sep 23, 2024
1 parent 24a96ab commit b4d5d22
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion invenio_banners/services/results.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2022-2023 CERN.
# Copyright (C) 2024 Graz University of Technology.
#
# Invenio-Banners is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

"""Service results."""
from flask_sqlalchemy import Pagination

from invenio_records_resources.services.records.results import 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 BannerItem(RecordItem):
"""Single banner result."""
Expand Down

0 comments on commit b4d5d22

Please sign in to comment.