Using the code below, I intend to use the datetime.utcnow() value as the default value for that field, but it gives an Attribute Error message that says 'SQLALchemy' object has no attribute 'Datetime'
from flask import Flask, flash, render_template, redirect, request, url_for
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///HRS.sqlite3'
app.config['SECRET_KEY'] = 'any key'
db = SQLAlchemy(app)
class Treatment(db.Model):
treatmentDate = db.Column('Date of treatment', db.Datetime, default=datetime.utcnow())