optimize __same__
This commit is contained in:
@ -341,8 +341,11 @@ class NewBaseModel(pydantic.BaseModel, ModelTableProxy, metaclass=ModelMetaclass
|
|||||||
return (
|
return (
|
||||||
self._orm_id == other._orm_id
|
self._orm_id == other._orm_id
|
||||||
or (self.pk == other.pk and self.pk is not None)
|
or (self.pk == other.pk and self.pk is not None)
|
||||||
or self.dict(exclude=self.extract_related_names())
|
or (
|
||||||
== other.dict(exclude=other.extract_related_names())
|
(self.pk is None and other.pk is None)
|
||||||
|
and self.dict(exclude=self.extract_related_names())
|
||||||
|
== other.dict(exclude=other.extract_related_names())
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user