flask-sqlalchemy

flask_uploads: ImportError: cannot import name 'secure_filename'

妖精的绣舞 提交于 2020-08-24 10:21:34
问题 I want to create a form that allows to send a picture with a description using flask forms. I tried to use this video: https://www.youtube.com/watch?v=Exf8RbgKmhM but I had troubles when launching app.py: ➜ website git:(master) ✗ python3.6 app.py Traceback (most recent call last): File "app.py", line 10, in <module> from flask.ext.uploads import UploadSet, configure_uploads, IMAGES ModuleNotFoundError: No module named 'flask.ext' I had to replace flask.ext.uploads by flask_uploads but now I

flask_uploads: ImportError: cannot import name 'secure_filename'

落花浮王杯 提交于 2020-08-24 10:19:52
问题 I want to create a form that allows to send a picture with a description using flask forms. I tried to use this video: https://www.youtube.com/watch?v=Exf8RbgKmhM but I had troubles when launching app.py: ➜ website git:(master) ✗ python3.6 app.py Traceback (most recent call last): File "app.py", line 10, in <module> from flask.ext.uploads import UploadSet, configure_uploads, IMAGES ModuleNotFoundError: No module named 'flask.ext' I had to replace flask.ext.uploads by flask_uploads but now I

flask_uploads: ImportError: cannot import name 'secure_filename'

末鹿安然 提交于 2020-08-24 10:18:34
问题 I want to create a form that allows to send a picture with a description using flask forms. I tried to use this video: https://www.youtube.com/watch?v=Exf8RbgKmhM but I had troubles when launching app.py: ➜ website git:(master) ✗ python3.6 app.py Traceback (most recent call last): File "app.py", line 10, in <module> from flask.ext.uploads import UploadSet, configure_uploads, IMAGES ModuleNotFoundError: No module named 'flask.ext' I had to replace flask.ext.uploads by flask_uploads but now I

How is a unique constraint across three columns defined?

坚强是说给别人听的谎言 提交于 2020-08-20 06:17:04
问题 The following EventInvitation model is a simple invitation for one event, sent from a user to another user. I would like to ensure that the invitations are unique across three columns: to_user, from_user and event. class EventInvitation(db.Model): __tablename__ = 'event_invitations' id = db.Column(db.Integer, primary_key = True) event_id = db.Column(db.Integer, db.ForeignKey('events.id')) event = db.relationship('Event', foreign_keys=[event_id]) created = db.Column(db.DateTime(), default

flask_sqlalchemy: error with `__setattr__` to `DefaultMeta`

∥☆過路亽.° 提交于 2020-08-19 11:23:58
问题 After re-building a Docker image, I've started to get the following error: $ docker run --rm -it python:3.8-slim /bin/bash ... $ pip install flask_sqlalchemy ... $ python -c "from flask_sqlalchemy import SQLAlchemy; SQLAlchemy()" Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 715, in __init__ self.Model = self.make_declarative_base(model_class, metadata) File "/usr/local/lib/python3.8

Git lab CI Running nose tests with SqlAlchemy. ERROR: Failure: TypeError (can't apply this __setattr__ to DefaultMeta object)

强颜欢笑 提交于 2020-08-09 18:22:25
问题 I am working on a Flask Application with a Postgres database. When I run nose tests locally everything works fine, but when I upload the code to GitLab this happens in my pipeline. I am using gitlab-ci . Any suggestions on how to solve this issue are welcome. $ nosetests --with-coverage --cover-package=app EEEEE ====================================================================== ERROR: Failure: TypeError (can't apply this __setattr__ to DefaultMeta object) ---------------------------------