forked from abhishek-UM/UrbanMatch-PythonTask
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschemas.py
More file actions
44 lines (31 loc) · 742 Bytes
/
schemas.py
File metadata and controls
44 lines (31 loc) · 742 Bytes
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 pydantic import BaseModel
from typing import List
class UserBase(BaseModel):
name: str
age: int
gender: str
email: str
city: str
interests: List[str]
class UserCreate(UserBase):
pass
class User(UserBase):
id: int
class Config:
orm_mode = True
# New schema: used to identify a user by name and email
class UserIdentifier(BaseModel):
name: str
email: str
# Define the CandidateSuggestion schema for match suggestions
class CandidateSuggestion(BaseModel):
id: int
name: str
email: str
age: int
gender: str
city: str
interests: List[str]
match_percentage: float # Compatibility rating as a percentage
class Config:
orm_mode = True