Add Event and EventTheme models

Introduces models for events and their themes, including fields for event details, location, timing, and settings. The `EventTheme` model supports theme customization with color palettes and fonts, while establishing relationships with the `Event` model. These additions prepare the database for event-related functionality.
This commit is contained in:
2025-02-27 18:14:47 +01:00
parent dcdfe8732c
commit ca399e5c68
2 changed files with 81 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
from sqlalchemy import Column, String, JSON
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)
# Relationship with Event
events = relationship("Event", back_populates="theme")
def __repr__(self):
return f"<EventTheme {self.name}>"