prepare_next_rel

This commit is contained in:
collerek
2022-02-25 11:30:32 +01:00
parent f26fafe04c
commit be7a0ff9c1
6 changed files with 101 additions and 126 deletions

View File

@ -83,6 +83,7 @@ class MergeModelMixin:
setattr(other, field_name, value_to_set)
elif (
isinstance(current_field, ormar.Model)
and isinstance(other_value, ormar.Model)
and current_field.pk == other_value.pk
):
setattr(

View File

@ -909,7 +909,7 @@ class NewBaseModel(pydantic.BaseModel, ModelTableProxy, metaclass=ModelMetaclass
return base64.b64encode(value).decode()
return value
def _convert_json(self, column_name: str, value: Any) -> Union[str, Dict]:
def _convert_json(self, column_name: str, value: Any) -> Union[str, Dict, None]:
"""
Converts value to/from json if needed (for Json columns).