46 lines
1.5 KiB
Python
46 lines
1.5 KiB
Python
from pydantic import BaseModel, model_validator, Field, HttpUrl
|
|
from enum import StrEnum
|
|
from datetime import datetime
|
|
|
|
from fiber_package.base import FiberBaseModel
|
|
|
|
from .enums import CommunicationCategory
|
|
|
|
'''
|
|
A "communication" is a piece of communication/promotion to be shared with
|
|
members, which may appear on the website and in the weekly mailing.
|
|
'''
|
|
class CommunicationModel(FiberBaseModel):
|
|
category: CommunicationCategory
|
|
|
|
name_en: str
|
|
name_nl: str
|
|
|
|
association_tags = []
|
|
# list of associations this communication belongs to
|
|
|
|
subtitle_en: str
|
|
subtitle_nl: str
|
|
# subtitles currently (2026) appear only in the table of contents in the
|
|
# weekly mailing; they are meant to be a short catchy flavour text
|
|
|
|
description_en: str
|
|
description_nl: str
|
|
|
|
image: HttpUrl | None = None
|
|
# often, a poster comes associated with a communication (in particular if
|
|
# it's an activity). In that case, the poster is uploaded to the cloud and
|
|
# the share link is attached to the communication
|
|
# TODO: potentially rethink the way images are attached to communications
|
|
|
|
visibility: bool
|
|
# should this communication be shown to members at all? Useful for
|
|
# temporarily hiding a communication
|
|
|
|
only_members: bool
|
|
# is this communication only visible to members? This refers to visibility
|
|
# on the website, i.e. is this only visible to visitors who are logged in?
|
|
|
|
archived: bool
|
|
# an archived communication cannot be edited, only viewed for future
|
|
# reference |