The `is_active` field was introduced to the `EventTheme` model to indicate whether a theme is active. The corresponding test fixture in `conftest.py` was updated to include this new field, ensuring consistency in tests. This change enhances flexibility for managing event themes.
20 lines
655 B
Python
20 lines
655 B
Python
from sqlalchemy import Column, String, JSON, Boolean
|
|
from sqlalchemy.orm import relationship
|
|
from .base import Base, TimestampMixin, UUIDMixin
|
|
|
|
|
|
class EventTheme(Base, UUIDMixin, TimestampMixin):
|
|
__tablename__ = 'event_themes'
|
|
|
|
name = Column(String, nullable=False)
|
|
description = Column(String)
|
|
preview_image_url = Column(String)
|
|
color_palette = Column(JSON, nullable=False)
|
|
fonts = Column(JSON, nullable=False)
|
|
is_active = Column(Boolean, default=True, nullable=False)
|
|
|
|
# Relationship with Event
|
|
events = relationship("Event", back_populates="theme")
|
|
|
|
def __repr__(self):
|
|
return f"<EventTheme {self.name}>" |