We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a model definition:
from pydantic_extra_types.pendulum_dt import Date class TypeValuePair(BaseModel): """ type: value """ type: str = Field(...) value: str = Field(...) class Config: """ config """ populate_by_name = True json_schema_extra = { "example": {"type": "Subject Area", "value": "Drainage Sewage"} } class Transaction(BaseModel): """ transac, note, date """ transac: TypeValuePair = Field(...) note: TypeValuePair = Field(...) date: Date = Field(...) class Config: """ config """ populate_by_name = True arbitrary_types_allowed = True json_schema_extra = { "example": { "transac": { "type": "terminologyManagementTransactions", "value": "origination", }, "note": {"type": "responsibility", "value": "joanna.schroer"}, "date": "2015-03-09", } }
When I want to create an object of this model, it is not correctly decomposed to the pendulum Date type:
Transaction(transac=ml.TypeValuePair(type="", value=""), note=ml.TypeValuePair(type="", value=""), date="2015-03-09")
Returns:
Transaction(transac=TypeValuePair(type='', value=''), note=TypeValuePair(type='', value=''), date=datetime.date(2015, 3, 9))
Where the date parameter is type datetime.date instead of pendulum.Date. If I use DateTime instead of Date it works fine. What is the issue?
date
datetime.date
pendulum.Date
DateTime
Date
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a model definition:
When I want to create an object of this model, it is not correctly decomposed to the pendulum Date type:
Returns:
Where the
date
parameter is typedatetime.date
instead ofpendulum.Date
. If I useDateTime
instead ofDate
it works fine. What is the issue?The text was updated successfully, but these errors were encountered: