-
Notifications
You must be signed in to change notification settings - Fork 0
user model #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
user model #6
Conversation
|
Task linked: CU-86b1108nz DB - Create BOOKMARK Model |
| from datetime import datetime | ||
|
|
||
| class User(BaseModel): | ||
| id: str = Field(..., description="Unique identifier for the user") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your IDs should either be int or uuid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id here should be a str, because MongoDB's ObjectId is not JSON serializable. @DerekGuijt plz, wrap str as a PyObjectId: PyObjectId = Annotated[str, BeforeValidator(str)]
|
|
||
| class User(BaseModel): | ||
| id: str = Field(..., description="Unique identifier for the user") | ||
| email: EmailStr = Field(..., description="User's email address") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
email-validator is required to use EmailStr. Please add email-validator to the requirements.txt. Double check the correct package needed for email-validator.
khodizoda
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Please, address the comments and we can merge the PR.
This code is for the user model