Spaces:
Sleeping
Sleeping
File size: 719 Bytes
b4c9cb7 |
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 |
from pydantic import Field, EmailStr
from .BaseDocument import BaseDocument
from bson import ObjectId
def get_user(user) -> dict:
return {
"id": str(user["_id"]),
"username": user["username"],
"password": user["password"],
}
def list_serial(users) -> list:
return [get_user(user) for user in users]
class User(BaseDocument):
id: str = Field("", description="User's id")
username: str = Field("", description="User's username")
password: str = Field("", description="User's password")
class Config:
json_schema_extra = {
"example": {
"username": "johnUS192",
"password": "1234567890",
}
}
|