Flask/project_name/models.py

17 lines
467 B
Python
Raw Permalink Normal View History

2024-11-10 07:27:36 -08:00
from sqlalchemy_serializer import SerializerMixin
from project_name.ext.database import db
class Product(db.Model, SerializerMixin):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(140))
price = db.Column(db.Numeric())
description = db.Column(db.Text)
class User(db.Model, SerializerMixin):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(140))
password = db.Column(db.String(512))