Spaces:
Build error
Build error
File size: 876 Bytes
b7a7f32 |
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 |
from datetime import date, datetime
from typing import Optional, List
from datetime import datetime
from pydantic import BaseModel
# shared properties
class PersonalNoteBase(BaseModel):
user_id: int
tags: List[str] = None
title: str
content: str
last_updated_time: datetime
# properties to recieve via
class PersonalNoteCreate(BaseModel):
user_id: int
tags: List[str] = None
title: str
content: str
# properties to recive via API on Update
class PersonalNoteUpdate(BaseModel):
user_id: int = None
tags: List[str] = None
title: str = None
content: str = None
# properties to return via the api
class PersonalNoteInDBBase(PersonalNoteBase):
id: Optional[int]
class Config:
orm_mode = True
class PersonalNoteInDB(PersonalNoteInDBBase):
pass
class PersonalNote(PersonalNoteInDBBase):
pass
|