from flask import Flask
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

def connect_db(app):
    db.app = app
    db.init_app(app)

class Cupcake(db.Model):

    __tablename__ = "cupcakes"
    
    id=db.Column(db.Integer, primary_key=True, autoincrement=True)
    flavor=db.Column(db.Text, nullable=False)
    size=db.Column(db.Text, nullable=False)
    rating=db.Column(db.Float, nullable=False)
    image=db.Column(db.Text, nullable=False, default='https://tinyurl.com/demo-cupcake')

    def serialize(model):
        return {
            "id": model.id,
            "flavor": model.flavor,
            "size": model.size,
            "rating": model.rating,
            "image": model.image
            }
ac88c60c33411c3a3e9159749833b3924c9e6ad6
<mask token>


class Cupcake(db.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    def serialize(model):
        return {'id': model.id, 'flavor': model.flavor, 'size': model.size,
            'rating': model.rating, 'image': model.image}

<mask token>


def connect_db(app):
    db.app = app
    db.init_app(app)


class Cupcake(db.Model):
    __tablename__ = 'cupcakes'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    flavor = db.Column(db.Text, nullable=False)
    size = db.Column(db.Text, nullable=False)
    rating = db.Column(db.Float, nullable=False)
    image = db.Column(db.Text, nullable=False, default=
        'https://tinyurl.com/demo-cupcake')

    def serialize(model):
        return {'id': model.id, 'flavor': model.flavor, 'size': model.size,
            'rating': model.rating, 'image': model.image}

<mask token>
db = SQLAlchemy()


def connect_db(app):
    db.app = app
    db.init_app(app)


class Cupcake(db.Model):
    __tablename__ = 'cupcakes'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    flavor = db.Column(db.Text, nullable=False)
    size = db.Column(db.Text, nullable=False)
    rating = db.Column(db.Float, nullable=False)
    image = db.Column(db.Text, nullable=False, default=
        'https://tinyurl.com/demo-cupcake')

    def serialize(model):
        return {'id': model.id, 'flavor': model.flavor, 'size': model.size,
            'rating': model.rating, 'image': model.image}

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()


def connect_db(app):
    db.app = app
    db.init_app(app)


class Cupcake(db.Model):
    __tablename__ = 'cupcakes'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    flavor = db.Column(db.Text, nullable=False)
    size = db.Column(db.Text, nullable=False)
    rating = db.Column(db.Float, nullable=False)
    image = db.Column(db.Text, nullable=False, default=
        'https://tinyurl.com/demo-cupcake')

    def serialize(model):
        return {'id': model.id, 'flavor': model.flavor, 'size': model.size,
            'rating': model.rating, 'image': model.image}

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

def connect_db(app):
    db.app = app
    db.init_app(app)

class Cupcake(db.Model):

    __tablename__ = "cupcakes"
    
    id=db.Column(db.Integer, primary_key=True, autoincrement=True)
    flavor=db.Column(db.Text, nullable=False)
    size=db.Column(db.Text, nullable=False)
    rating=db.Column(db.Float, nullable=False)
    image=db.Column(db.Text, nullable=False, default='https://tinyurl.com/demo-cupcake')

    def serialize(model):
        return {
            "id": model.id,
            "flavor": model.flavor,
            "size": model.size,
            "rating": model.rating,
            "image": model.image
            }