monir
This commit is contained in:
+294
-119
@@ -1,164 +1,339 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List, Dict
|
||||
from datetime import datetime
|
||||
from typing import Optional, List, Dict, Union, Any
|
||||
|
||||
|
||||
# فیلد اجباری:
|
||||
# str = Field(..., description="")
|
||||
# str = Field(..., description=)
|
||||
# فیلد اختیاری:
|
||||
# Optional[str] = Field(None, description="")
|
||||
# Optional[str] = Field("", description=)
|
||||
|
||||
|
||||
class Properties(BaseModel):
|
||||
"""
|
||||
Standard Form Of Foreign Key To Other Index
|
||||
"""
|
||||
|
||||
id: str = Field(..., description="شناسه یکتا")
|
||||
title: str = Field(..., description="عنوان")
|
||||
author: str = Field(..., description="سازنده")
|
||||
sub_type: str = Field(..., description="نوع دوم")
|
||||
title: Optional[str] = Field("", description="عنوان")
|
||||
author: Optional[str] = Field("", description="سازنده")
|
||||
sub_type: Optional[str] = Field("", description="نوع دوم")
|
||||
|
||||
|
||||
class TreeInfo(BaseModel):
|
||||
title: str
|
||||
parent_id: str = Field(..., description="")
|
||||
child_order: int
|
||||
level: int
|
||||
full_path: Optional[str] = Field(None, description="")
|
||||
path_headings: str
|
||||
title: str
|
||||
parent_id: str = Field(..., description="")
|
||||
child_order: int
|
||||
level: int
|
||||
full_path: Optional[str] = Field("", description="")
|
||||
path_headings: str
|
||||
|
||||
|
||||
class NlpParses(BaseModel):
|
||||
main_type: str
|
||||
nlp_type: str
|
||||
begin: int
|
||||
end: int
|
||||
text: str
|
||||
referes: str
|
||||
dependency_infos:str # nested
|
||||
main_type: str
|
||||
nlp_type: str
|
||||
begin: int
|
||||
end: int
|
||||
text: str
|
||||
referes: str
|
||||
dependency_infos: str # nested
|
||||
|
||||
|
||||
class Embeddings(BaseModel):
|
||||
type: Optional[str] = Field(None, description=""),
|
||||
dims: Optional[int] = Field(1024, description=""),
|
||||
index: Optional[bool] = Field(True, description=""),
|
||||
similarity: Optional[str] = Field(None, description="")
|
||||
type: Optional[str] = (Field("", description=""),)
|
||||
dims: Optional[int] = (Field(1024, description=""),)
|
||||
index: Optional[bool] = (Field(True, description=""),)
|
||||
similarity: Optional[str] = Field("", description="")
|
||||
|
||||
|
||||
class FileLinks(BaseModel):
|
||||
title: str
|
||||
link: str
|
||||
type: str
|
||||
description: str
|
||||
title: str
|
||||
link: str
|
||||
type: str
|
||||
description: str
|
||||
|
||||
|
||||
class UserLogs(BaseModel):
|
||||
id: str
|
||||
user_id: int
|
||||
username: str
|
||||
time_edit: datetime
|
||||
property: str
|
||||
id: str
|
||||
user_id: int
|
||||
username: str
|
||||
time_edit: int
|
||||
property: str
|
||||
|
||||
|
||||
class MnSection(BaseModel):
|
||||
id: str
|
||||
main_type: str
|
||||
html: str
|
||||
content: str
|
||||
meet_info: Properties
|
||||
term_info: Properties
|
||||
tree_info: TreeInfo
|
||||
content_len: int
|
||||
word_len: int
|
||||
tags: str
|
||||
keywords: str
|
||||
sort_date_timestamp: int
|
||||
nlp_parses: NlpParses
|
||||
embeddings: Embeddings
|
||||
file_links: FileLinks
|
||||
time_edit: datetime
|
||||
user_edit: int
|
||||
user_logs: UserLogs
|
||||
id: str
|
||||
old_id: str
|
||||
main_type: str
|
||||
html: str
|
||||
content: str
|
||||
meet_info: Properties
|
||||
term_info: Properties
|
||||
tree_info: TreeInfo
|
||||
content_len: int
|
||||
word_len: int
|
||||
tags: str
|
||||
keywords: str
|
||||
sort_date_timestamp: int
|
||||
nlp_parses: NlpParses
|
||||
embeddings: Embeddings
|
||||
file_links: FileLinks
|
||||
time_edit: int
|
||||
user_edit: int
|
||||
user_logs: UserLogs
|
||||
|
||||
|
||||
class MnTerm(BaseModel):
|
||||
id: str
|
||||
author: str
|
||||
sub_type: Optional[str] = ""
|
||||
title: Optional[str] = ""
|
||||
begin_date: Optional[int] = ""
|
||||
end_date: Optional[int] = ""
|
||||
begin_year: Optional[int] = ""
|
||||
main_type: Optional[str] = ""
|
||||
content: Optional[str] = ""
|
||||
tags: Optional[str] = ""
|
||||
keywords: Optional[str] = ""
|
||||
|
||||
|
||||
class MnMeetEntity(BaseModel):
|
||||
id: str
|
||||
main_type: str
|
||||
sub_type: str
|
||||
title: str
|
||||
content: str
|
||||
author: str
|
||||
begin_date: datetime
|
||||
end_date: datetime
|
||||
begin_year: int
|
||||
tags: str
|
||||
keywords: str
|
||||
permit_tags: str
|
||||
search_state: str
|
||||
user_create: str
|
||||
time_create: int
|
||||
time_edit: int
|
||||
file_links: FileLinks
|
||||
meet_info: Properties
|
||||
term_info: Properties
|
||||
|
||||
|
||||
class MnMeetEntity(BaseModel):
|
||||
id: str
|
||||
main_type: str
|
||||
sub_type: str
|
||||
title: str
|
||||
content: str
|
||||
permit_tags: str
|
||||
search_state: str
|
||||
user_create: str
|
||||
time_create: datetime
|
||||
time_edit: datetime
|
||||
file_links: FileLinks
|
||||
meet_info: Properties
|
||||
term_info: Properties
|
||||
|
||||
class Subjects(BaseModel):
|
||||
id: int
|
||||
title: str
|
||||
id: int
|
||||
title: str
|
||||
|
||||
|
||||
class ReportInfo(BaseModel):
|
||||
film_count: int
|
||||
sound_count: int
|
||||
photo_count: int
|
||||
file_count: int
|
||||
is_address: int
|
||||
is_mindex: int
|
||||
is_mintro: int
|
||||
is_sanad_data1: int
|
||||
is_sanad_data2: int
|
||||
films: int
|
||||
sounds: int
|
||||
photos: int
|
||||
|
||||
|
||||
class MnMeet(BaseModel):
|
||||
"""
|
||||
Monir Meet Standard fields foramt
|
||||
"""
|
||||
id: str
|
||||
main_type: str
|
||||
sub_type: str
|
||||
person_code: str
|
||||
research_code: str
|
||||
meet_code: str
|
||||
old_meet_id: int
|
||||
"""
|
||||
Monir Meet Standard fields foramt
|
||||
"""
|
||||
|
||||
id: str
|
||||
sanad_id: str
|
||||
main_type: str
|
||||
sub_type: Optional[str] = ""
|
||||
person_code: Optional[str] = ""
|
||||
research_code: str
|
||||
meet_code: str
|
||||
old_meet_id: int
|
||||
title: str
|
||||
meet_no: int
|
||||
author: str
|
||||
term_info: Optional[Properties] = Field("", description="کلید اتصال به جدول ترم")
|
||||
subtitle: str
|
||||
subjects: Optional[List[Subjects]] = []
|
||||
allwords: str
|
||||
tags: Optional[List[str]] = []
|
||||
keywords: str
|
||||
verb: str
|
||||
sanad_year: Optional[int] = ""
|
||||
sanad_date: Optional[int] = ""
|
||||
amplify: str
|
||||
ralation: str
|
||||
city: str
|
||||
place: str
|
||||
address: str
|
||||
audience: str
|
||||
attendees: str
|
||||
report_info: ReportInfo
|
||||
mindex: Optional[str] = Field("", description="mindex index فهرست")
|
||||
mintro: Optional[str] = Field("", description="mintro خلاصه ")
|
||||
content: str
|
||||
completion: Optional[str] = Field("", description="type: completion")
|
||||
sort_date_timestamp: int
|
||||
permit_tags: str
|
||||
resource_info: str
|
||||
|
||||
|
||||
class MnSanadLink(BaseModel):
|
||||
text: Optional[str] = ""
|
||||
link: str
|
||||
in_search: bool
|
||||
title: str
|
||||
|
||||
|
||||
|
||||
class Properties(BaseModel):
|
||||
"""
|
||||
Standard Form Of Foreign Key To Other Index
|
||||
"""
|
||||
|
||||
id: str = Field(..., description="شناسه یکتا")
|
||||
title: Optional[str] = Field("", description="عنوان")
|
||||
author: Optional[str] = Field("", description="سازنده")
|
||||
sub_type: Optional[str] = Field("", description="نوع دوم")
|
||||
|
||||
class TreeProperties(BaseModel):
|
||||
parent_id :str
|
||||
child_order: int
|
||||
level: int
|
||||
full_path: str
|
||||
title: str
|
||||
meet_no: int
|
||||
author: str
|
||||
term_info: Properties
|
||||
subtitle: str
|
||||
subjects: Subjects
|
||||
allwords: str
|
||||
tags: str
|
||||
keywords: str
|
||||
verb: str
|
||||
sanad_year: int
|
||||
sanad_date: datetime
|
||||
amplify: str
|
||||
ralation: str
|
||||
city: str
|
||||
place: str
|
||||
address: str
|
||||
audience: str
|
||||
attendees: str
|
||||
report_info: ReportInfo
|
||||
mindex: str
|
||||
mintro: str
|
||||
content: str
|
||||
completion: Optional[str] = Field(None, description="type: completion")
|
||||
sort_date_timestamp: int
|
||||
permit_tags: str
|
||||
resource_info: str
|
||||
path_headings: str
|
||||
|
||||
class NlpParses(BaseModel):
|
||||
main_type: str
|
||||
nlp_type: str
|
||||
begin: int
|
||||
end: int
|
||||
text: str
|
||||
referes: str
|
||||
dependency_infos: Dict
|
||||
|
||||
class UserLogs(BaseModel):
|
||||
id:str
|
||||
user_id:int
|
||||
username:str
|
||||
time_edit:int
|
||||
property:str
|
||||
|
||||
class MNSection(BaseModel):
|
||||
main_type : str
|
||||
id : str
|
||||
html : str
|
||||
content : str
|
||||
meet_info: Properties
|
||||
term_info: Properties
|
||||
tree_info: TreeProperties
|
||||
content_len: int
|
||||
word_len: int
|
||||
tags: str
|
||||
keywords: str
|
||||
sort_date_timestamp: int
|
||||
nlp_parses: NlpParses
|
||||
embeddings: Embeddings
|
||||
file_links:FileLinks
|
||||
time_edit: int
|
||||
user_edit: int
|
||||
user_logs: UserLogs
|
||||
|
||||
|
||||
class MnSanadVersionInfo(BaseModel):
|
||||
timestamp: int
|
||||
number: int
|
||||
title: str
|
||||
|
||||
|
||||
class SoundLinks(BaseModel):
|
||||
link: str
|
||||
title: str
|
||||
|
||||
|
||||
class MnSanad(BaseModel):
|
||||
id: Optional[str] = ""
|
||||
sort_date_timestamp: Optional[int] = ""
|
||||
title: Optional[str] = ""
|
||||
subtitle: Optional[str] = ""
|
||||
research_code: Optional[int] = ""
|
||||
content: Optional[str] = ""
|
||||
version_info: Optional[MnSanadVersionInfo] = ""
|
||||
meet_lid: Optional[int] = ""
|
||||
meet_id: Optional[int] = ""
|
||||
meet_no: Optional[int] = ""
|
||||
meet_code: Optional[int] = ""
|
||||
allwords: Optional[str] = ""
|
||||
keywords: Optional[str] = ""
|
||||
person_code: Optional[str] = ""
|
||||
subject: Optional[List] = ""
|
||||
city: Optional[str] = ""
|
||||
author: str
|
||||
begin_year: Optional[int] = ""
|
||||
begin_date: Optional[int] = ""
|
||||
end_date: Optional[int] = ""
|
||||
branch: Optional[str] = ""
|
||||
ralation: Optional[str] = ""
|
||||
research_id: Optional[int] = ""
|
||||
mintro: Optional[str] = ""
|
||||
mindex: Optional[str] = ""
|
||||
RowNum: Optional[int] = ""
|
||||
resource_info: Optional[str] = ""
|
||||
in_tadvin: Optional[bool] = ""
|
||||
format: Optional[str] = ""
|
||||
verb: Optional[str] = ""
|
||||
address: Optional[str] = ""
|
||||
attendees: Optional[str] = ""
|
||||
amplify: Optional[str] = ""
|
||||
audience: Optional[str] = ""
|
||||
place: Optional[str] = ""
|
||||
permit_tags: Optional[str] = ""
|
||||
photos: Optional[int] = ""
|
||||
tags: Optional[List[str]] = ""
|
||||
films: Optional[int] = ""
|
||||
sounds: Optional[int] = ""
|
||||
file_links: Optional[List[MnSanadLink]] = ""
|
||||
sound_links: Optional[List[SoundLinks]] = ""
|
||||
video_links: Optional[List[SoundLinks]] = ""
|
||||
photo_links: Optional[List[SoundLinks]] = ""
|
||||
|
||||
model_config = {"exclude_" "": True}
|
||||
|
||||
|
||||
class MnSanad2Meet(BaseModel):
|
||||
id: str
|
||||
sort_date_timestamp: Optional[int] = ""
|
||||
title: str
|
||||
subtitle: str
|
||||
research_code: str
|
||||
format: str
|
||||
content: str
|
||||
# version_info: Optional[List|dict] = ""
|
||||
meet_lid: Optional[str] = ""
|
||||
meet_id: Optional[int] = ""
|
||||
meet_no: Optional[int] = ""
|
||||
meet_code: Optional[str] = ""
|
||||
allwords: Optional[str] = ""
|
||||
keywords: Optional[str] = ""
|
||||
person_code: Optional[str] = ""
|
||||
subject: Optional[List] = []
|
||||
city: Optional[str] = ""
|
||||
author: str
|
||||
begin_year: Optional[int] = ""
|
||||
begin_date: Optional[str] = ""
|
||||
end_date: Optional[str] = ""
|
||||
branch: str
|
||||
ralation: Optional[str] = ""
|
||||
research_id: int
|
||||
mintro: Optional[str] = ""
|
||||
mindex: Optional[str] = ""
|
||||
# RowNum: Optional[int]= ""
|
||||
resource_info: Optional[str] = ""
|
||||
# in_tadvin: Optional[bool] = ""
|
||||
verb: Optional[str] = ""
|
||||
address: Optional[str] = ""
|
||||
attendees: Optional[str] = ""
|
||||
amplify: Optional[str] = ""
|
||||
audience: Optional[str] = ""
|
||||
place: Optional[str] = ""
|
||||
permit_tags: Optional[str] = ""
|
||||
photos: Optional[int] = 0
|
||||
tags: Optional[List[str]] = []
|
||||
films: Optional[int] = 0
|
||||
sounds: Optional[int] = 0
|
||||
file_links: Optional[List[MnSanadLink]] = ""
|
||||
sound_links: Optional[List[SoundLinks]] = ""
|
||||
video_links: Optional[List[SoundLinks]] = ""
|
||||
photo_links: Optional[List[SoundLinks]] = ""
|
||||
|
||||
# model_config = {
|
||||
# "exclude_""": True
|
||||
# }
|
||||
|
||||
Reference in New Issue
Block a user