Commit e21bc12b authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Switch to non deprecated pydantic method

paramater has only switched name, does exactly the same thing as before
parent 52311e92
......@@ -21,13 +21,13 @@ class BaseModel(pydantic.BaseModel):
data = json.loads(json_data)
return cls.from_dict(data)
def dict(self, by_alias=True, skip_defaults=True, *args, **kwargs):
def dict(self, by_alias=True, exclude_unset=True, *args, **kwargs):
return super().dict(
by_alias=by_alias, skip_defaults=skip_defaults, *args, **kwargs)
by_alias=by_alias, exclude_unset=exclude_unset, *args, **kwargs)
def json(self, by_alias=True, skip_defaults=True, *args, **kwargs):
def json(self, by_alias=True, exclude_unset=True, *args, **kwargs):
return super().json(
by_alias=by_alias, skip_defaults=skip_defaults, *args, **kwargs)
by_alias=by_alias, exclude_unset=exclude_unset, *args, **kwargs)
class Identifier(BaseModel):
......@@ -196,11 +196,11 @@ class Operator(BaseModel):
def dict(self, *args, **kwargs):
kwargs['exclude'] = {'id'}
kwargs['skip_defaults'] = False
kwargs['exclude_unset'] = False
return super(Operator, self).dict(*args, **kwargs)
def inclusive_dict(self, *args, **kwargs):
kwargs['skip_defaults'] = False
kwargs['exclude_unset'] = False
return super(Operator, self).dict(*args, **kwargs)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment