updated deps for flask-restless-ng and SQLAlchemy

This commit is contained in:
Sebastian Rieger 2023-09-27 10:53:18 +02:00
parent a50038ffd5
commit 0101ae4b97
2 changed files with 27 additions and 16 deletions

View File

@ -101,7 +101,7 @@ class Fractal(db.Model):
with app.app_context(): with app.app_context():
db.create_all() db.create_all()
manager = APIManager(app, flask_sqlalchemy_db=db) manager = APIManager(app=app, session=db.session)
connection = Connection(CONF.transport_url) connection = Connection(CONF.transport_url)
@ -110,8 +110,8 @@ connection = Connection(CONF.transport_url)
@app.route('/index/<int:page>', methods=['GET']) @app.route('/index/<int:page>', methods=['GET'])
def index(page=1): def index(page=1):
fractals = Fractal.query.filter( fractals = Fractal.query.filter(
(Fractal.checksum != None) & (Fractal.size != None)).paginate( # noqa (Fractal.checksum != None) & (Fractal.size != None)).paginate(
page, 5, error_out=False) page=page, per_page=5)
return flask.render_template('index.html', fractals=fractals) return flask.render_template('index.html', fractals=fractals)
@ -147,6 +147,6 @@ def main():
with app.app_context(): with app.app_context():
manager.create_api(Fractal, methods=['GET', 'POST', 'DELETE', 'PUT'], manager.create_api(Fractal, methods=['GET', 'POST', 'DELETE', 'PUT'],
postprocessors={'POST': [generate_fractal]}, postprocessors={'POST': [generate_fractal]},
exclude_columns=['image'], exclude=['image'],
url_prefix='/v1') url_prefix='/v1')
app.run(host=CONF.listen_address, port=CONF.bind_port) app.run(host=CONF.listen_address, port=CONF.bind_port)

View File

@ -1,20 +1,31 @@
pbr>=1.6 #pbr>=1.6
pbr
pytz pytz
positional positional
iso8601 iso8601
anyjson>=0.3.3 #anyjson>=0.3.3
eventlet>=0.17.4 anyjson
#eventlet>=0.17.4
eventlet
#PyMySQL>=0.6.2,<0.7 # 0.7 design change breaks faafo, MIT License #PyMySQL>=0.6.2,<0.7 # 0.7 design change breaks faafo, MIT License
PyMySQL>=0.6.2 #PyMySQL>=0.6.2
PyMySQL
#SQLAlchemy>1.3,<1.4 # 1.4 breaks faafo list #SQLAlchemy>1.3,<1.4 # 1.4 breaks faafo list
SQLAlchemy>=2.0.16 #SQLAlchemy>=2.0.16
Pillow==2.4.0 # MIT SQLAlchemy
requests>=2.5.2 #Pillow==2.4.0 # MIT
Pillow
#requests>=2.5.2
requests
Flask-Bootstrap Flask-Bootstrap
Flask Flask
flask-restless flask-restless-ng
flask-sqlalchemy flask-sqlalchemy
oslo.config>=2.3.0 # Apache-2.0 #oslo.config>=2.3.0 # Apache-2.0
oslo.log>=1.8.0 # Apache-2.0 #oslo.log>=1.8.0 # Apache-2.0
PrettyTable>=0.7,<0.8 #PrettyTable>=0.7,<0.8
kombu>=3.0.7 #kombu>=3.0.7
oslo.config
oslo.log
PrettyTable
kombu