Add new fields to event theme model for asset handling
Added `background_image_url`, `foreground_image_url`, and `asset_image_urls` fields to enhance theme customization. Updated `asset_image_urls` to use `MutableDict` with a default empty dictionary and ensured consistency in the model and migration script.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
from typing import Dict
|
||||
|
||||
from sqlalchemy import Column, String, JSON, Boolean
|
||||
from sqlalchemy.ext.mutable import MutableDict
|
||||
from sqlalchemy.orm import relationship
|
||||
from .base import Base, TimestampMixin, UUIDMixin
|
||||
|
||||
@@ -9,9 +12,14 @@ class EventTheme(Base, UUIDMixin, TimestampMixin):
|
||||
name = Column(String, nullable=False)
|
||||
description = Column(String)
|
||||
preview_image_url = Column(String)
|
||||
background_image_url = Column(String, nullable=True)
|
||||
foreground_image_url = Column(String, nullable=True)
|
||||
asset_image_urls: Dict[str, str] = Column(MutableDict.as_mutable(JSON), default=dict)
|
||||
|
||||
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")
|
||||
|
||||
Reference in New Issue
Block a user