Comments (1)
Do you have the following at the top of your models.py:
from sqlalchemy.sql import func
If you do and it still isn't working make sure you installed sqlalchemy like he did at the beginning of the video. Below is my code for models.py if it helps:
from . import db
from flask_login import UserMixin
from sqlalchemy.sql import func
class Note(db.Model):
id = db.Column(db.Integer, primary_key=True)
data = db.Column(db.String(10000))
date = db.Column(db.DateTime(timezone=True), default=func.now())
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(150), unique=True)
password = db.Column(db.String(150))
first_name = db.Column(db.String(150))
notes = db.relationship('Note')
from flask-web-app-tutorial.
Related Issues (20)
- Sending data from form to python console HOT 1
- ValueError: Invalid hash method 'sha256'. HOT 15
- Noob I am HOT 1
- Alert message in home page HOT 1
- HEEELPPPP!! HOT 1
- I've corrected the call to create_all(), but no database file is created HOT 2
- Error in getting the url address after the installation of pip HOT 4
- Not an issue but a solution
- home.html
- why after reinstallation the database can't be reused
- address challenges encountered in implementing the QC test on the data arrays
- TypeError: object of type 'NoneType' has no len() HOT 1
- AttributeError: type object 'SQLAlchemy' has no attribute 'Model' HOT 1
- Only blank screen HOT 1
- Can't run main.py HOT 2
- ValueError: Invalid hash method 'sha256' HOT 3
- Flask Web Dev course
- FLASH MESSAGES NOT SHOWING IN LOGIN PAGE HOT 1
- Getting this Error: TypeError: Response.__call__() missing 2 required positional arguments: 'environ' and 'start_response'
- nothing is being deleted. I think smth to do w buttons. The delete button can't be triggered
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-web-app-tutorial.