Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
)

import logging
import warnings
from datetime import (
datetime,
)
Expand Down Expand Up @@ -76,6 +77,10 @@ def __getattr__(self, item: str) -> Any:
raise exc

def get_one(self, name: str, return_diff: bool = False) -> Union[FieldDiff, Any, list[FieldDiff], list[Any]]:
warnings.warn("get_one() method is deprecated by get_attr() and will be removed soon.", DeprecationWarning)
return self.get_attr(name, return_diff)

def get_attr(self, name: str, return_diff: bool = False) -> Union[FieldDiff, Any, list[FieldDiff], list[Any]]:
"""Get first field diff with given name.

:param name: The name of the field diff.
Expand All @@ -86,6 +91,10 @@ def get_one(self, name: str, return_diff: bool = False) -> Union[FieldDiff, Any,
return self.fields_diff.get_one(name, return_diff)

def get_all(self, return_diff: bool = False) -> dict[str, Union[FieldDiff, Any, list[FieldDiff], list[Any]]]:
warnings.warn("get_all() method is deprecated by get_attrs() and will be removed soon.", DeprecationWarning)
return self.get_attrs(return_diff)

def get_attrs(self, return_diff: bool = False) -> dict[str, Union[FieldDiff, Any, list[FieldDiff], list[Any]]]:
"""Get all field diffs with given name.

:param return_diff: If ``True`` the result is returned as field diff instances, otherwise the result is
Expand Down