add day rating feature
This commit is contained in:
@@ -10,6 +10,14 @@ ID_MAPPINGS = {
|
||||
}
|
||||
ID_MAPPINGS_REV = dict((v, k) for k, v in ID_MAPPINGS.items())
|
||||
|
||||
RATING_MAPPING = {
|
||||
1: "😵",
|
||||
2: "☹️",
|
||||
3: "😐",
|
||||
4: "😃",
|
||||
5: "🥰"
|
||||
}
|
||||
|
||||
MEDIA_DIR = Path(os.getenv("MEDIA_DIR"))
|
||||
MEDIA_DIR.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -28,7 +36,7 @@ class JournalEntry(BaseModel):
|
||||
text = TextField(null=True)
|
||||
media_path = TextField(null=True)
|
||||
last_shown = DateField(null=True)
|
||||
|
||||
rating = IntegerField(null=True) # mapped by RATING_MAPPING
|
||||
|
||||
@property
|
||||
def media(self):
|
||||
@@ -69,7 +77,7 @@ class JournalEntry(BaseModel):
|
||||
"("
|
||||
"(((?<=(\.|\!|\?)\s)[A-Z])|(^[A-Z]))" # beginning of a sentence
|
||||
"([^\.\!\?])+" # any character being part of a sentence
|
||||
"((\:\))|😇|😈)" # the smiley
|
||||
"((\:\))|😇|😈|[Ss]ex)" # the smiley
|
||||
"([^\.\!\?])*" # continuation of sentence
|
||||
"(\.|\!|\?|\,|$)" # end of the sentence
|
||||
")"
|
||||
|
Reference in New Issue
Block a user