-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodels.py
42 lines (35 loc) · 904 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
from enum import Enum
from typing import List
from pydantic import BaseModel
from uuid import uuid4
from datetime import datetime
class Status(str, Enum):
draft = "Draft"
ready = "Ready"
scheduled = "Scheduled"
done = "Done"
class TweetText(BaseModel):
content: str = None
max_length: int = 280
class Tweet(BaseModel):
uuid = uuid4()
tweet_id: float = None
tweet_text = TweetText()
# TODO: does this work?
status: Enum = Status("Draft")
publish_time: datetime = None
link: str = ""
retweet_time: datetime = None
retweet_status = Status("Draft")
likes: int = 0
retweets: int = 0
impressions: int = 0
profile_visits: int = 0
link_clicks: int = 0
replies: int = 0
class TweetThread(BaseModel):
uuid = uuid4()
tweets: List[Tweet]
max_tweets = 25
first_tweet: Tweet = None
last_tweet: Tweet = None