python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Pydantic set variables from a list
Is there a way to set a pydantic model from a list? I tried this and it didn't work for me. If it's not possible with pydantic, what is the best way to do this if I still need type validation and conv...
Superbman
Votes: 0
Answers: 2
Return list representation in pydantic root validator
I am using pydantic to validate data from a REST API and really like the package so far:
from datetime import datetime
from typing import Optional, List, Union
from pydantic import BaseModel, Field, r...

Cord Kaldemeyer
Votes: 0
Answers: 1
document pydantic.BaseSettings/BaseModel based classes with sphinx autoapi
I wrote a class like this:
class ComponentData(pydantic.BaseSetting):
"""dummy doc-string"""
att1: str = pydantic.Field(default="def1")
""...
Valentin Dumitru
Votes: 0
Answers: 0
Not able to patch datetime.utcnow in a custom type based on Pydantic's BaseModel
I am not able to patch datetime.utcnow correctly and I am wondering what could be wrong. The code below illustrates the idea:
# In a file called 'my_module.py'
from datetime import datetime
from pydan...
Gros Lalo
Votes: 0
Answers: 0