28 lines
695 B
Python
28 lines
695 B
Python
|
from pydantic import BaseModel, EmailStr
|
||
|
from pydantic_mongo import AbstractRepository, ObjectIdField
|
||
|
from datetime import datetime, date
|
||
|
from pydantic.networks import IPvAnyAddress
|
||
|
|
||
|
class IpAddress(BaseModel):
|
||
|
id: ObjectIdField = None
|
||
|
username: str
|
||
|
ip: IPvAnyAddress
|
||
|
socialnetwork: List[str] | None = None
|
||
|
|
||
|
class IpAddressOut(BaseModel):
|
||
|
id: ObjectIdField = None
|
||
|
username: str
|
||
|
ip: IPvAnyAddress
|
||
|
socialnetwork: List[str] | None = None
|
||
|
|
||
|
|
||
|
class IpAddressIn(BaseModel):
|
||
|
username: str
|
||
|
ip: IPvAnyAddress
|
||
|
socialnetwork: List[str] | None = None
|
||
|
|
||
|
|
||
|
|
||
|
class IpAddressRepository(AbstractRepository[IpAdress]):
|
||
|
class Meta:
|
||
|
collection_name = "ipaddress"
|