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

FileUpload object has no attribute 'Model' #122

Closed
Dev-Laurin opened this issue Oct 25, 2021 · 2 comments
Closed

FileUpload object has no attribute 'Model' #122

Dev-Laurin opened this issue Oct 25, 2021 · 2 comments

Comments

@Dev-Laurin
Copy link

AttributeError: 'FileUpload' object has no attribute 'Model'

@file_upload.Model
class Post(db.Model):
	id = db.Column(db.Integer, primary_key=True)
	....
	image = file_upload.Column(db)
	image_alt = db.Column(db.String(100))
	....

	def __repr__(self):
		return '<Post %r>' % self.title 
@Dev-Laurin
Copy link
Author

I found the issue. I was initiating the file_upload after I was trying to use it. Not sure how this worked in a previous version.

@joegasewicz
Copy link
Owner

   # If you require importing your SQLAlchemy models then make sure you import
    # your models after calling `file_upload.init_app(app, db)` or `FileUpload(app, db)`. 
    from .model import * 

There is an issue open for this #111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants