-
Notifications
You must be signed in to change notification settings - Fork 23
/
models.py
58 lines (41 loc) · 1007 Bytes
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
"""
byceps.services.news.transfer.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from dataclasses import dataclass
from datetime import datetime
from typing import List, NewType
from uuid import UUID
from ....typing import BrandID, UserID
ChannelID = NewType('ChannelID', str)
ItemID = NewType('ItemID', UUID)
ItemVersionID = NewType('ItemVersionID', UUID)
ImageID = NewType('ImageID', UUID)
@dataclass(frozen=True)
class Channel:
id: ChannelID
brand_id: BrandID
url_prefix: str
@dataclass(frozen=True)
class Image:
id: ImageID
created_at: datetime
creator_id: UserID
item_id: ItemID
filename: str
alt_text: str
caption: str
@dataclass(frozen=True)
class Item:
id: ItemID
channel: Channel
slug: str
published_at: datetime
published: bool
title: str
body: str
external_url: str
image_url_path: str
images: List[Image]