from sqlalchemy import ForeignKey, Column, Integer, TIMESTAMP, Float from sqlalchemy.orm import relationship from .base_model import Base class Cart(Base): __tablename__ = 'cart' id = Column(Integer, primary_key=True) user_id = Column(Integer, ForeignKey('user.id'), nullable=False) total = Column(Float, nullable=False) last_updated = Column(TIMESTAMP) user = relationship('User', back_populates='carts') entries = relationship('CartEntry', back_populates='cart')