models#
Enhance the pynamodb.models.Model class.
- class pynamodb_mate.models.ConsoleUrlMaker[source]#
Create common AWS Dynamodb Console url.
- table_overview(region_name: str, table_name: str) str[source]#
Create the AWS Console url that can preview Dynamodb Table overview.
- class pynamodb_mate.models.Model(hash_key: Optional[Any] = None, range_key: Optional[Any] = None, **attributes)[source]#
Pynamodb Model with additional features.
New in version 5.1.0.1.
- classmethod get_one_or_none(hash_key: Any, range_key: Optional[Any] = None, consistent_read: bool = False, attributes_to_get: Optional[Sequence[str]] = None) Optional[T_MODEL][source]#
Get one Dynamodb item object or None if not exists.
New in version 5.3.4.1.
- delete_if_exists() bool[source]#
Delete the item if exists. Return True if exists.
New in version 5.3.4.1.
- classmethod delete_all() int[source]#
Delete all item in a Dynamodb table by scanning all item and delete.
New in version 5.3.4.1.
- classmethod get_table_overview_console_url() str[source]#
Create the AWS Console url that can preview Dynamodb Table settings.
New in version 5.2.1.1.
- classmethod get_table_items_console_url() str[source]#
Create the AWS Console url that can preview items in Dynamodb Table.
New in version 5.2.1.1.
- property item_detail_console_url: str#
Return the AWS Console url that can preview Dynamodb item data.
New in version 5.2.1.1.
- classmethod iter_scan(filter_condition: Optional[Condition] = None, segment: Optional[int] = None, total_segments: Optional[int] = None, limit: Optional[int] = None, last_evaluated_key: Optional[Dict[str, Dict[str, Any]]] = None, page_size: Optional[int] = None, consistent_read: Optional[bool] = None, index_name: Optional[str] = None, rate_limit: Optional[float] = None, attributes_to_get: Optional[Sequence[str]] = None) IterProxy[_T][source]#
Similar to the
Model.scan()method, but it returns a more user-friendly iterator with type hint.New in version 5.3.4.6.
- classmethod iter_query(hash_key: Any, range_key_condition: Optional[Condition] = None, filter_condition: Optional[Condition] = None, consistent_read: bool = False, index_name: Optional[str] = None, scan_index_forward: Optional[bool] = None, limit: Optional[int] = None, last_evaluated_key: Optional[Dict[str, Dict[str, Any]]] = None, attributes_to_get: Optional[Iterable[str]] = None, page_size: Optional[int] = None, rate_limit: Optional[float] = None) IterProxy[_T][source]#
Similar to the
Model.query()method, but it returns a more user-friendly iterator with type hint.New in version 5.3.4.6.
- classmethod iter_scan_index(index: Union[GlobalSecondaryIndex, LocalSecondaryIndex], filter_condition: Optional[Condition] = None, segment: Optional[int] = None, total_segments: Optional[int] = None, limit: Optional[int] = None, last_evaluated_key: Optional[Dict[str, Dict[str, Any]]] = None, page_size: Optional[int] = None, consistent_read: Optional[bool] = None, rate_limit: Optional[float] = None, attributes_to_get: Optional[List[str]] = None) IterProxy[_T][source]#
Similar to the
Index.scan()method, but it returns a more user-friendly iterator with type hint.- Parameters:
index – the
GlobalSecondaryIndexorLocalSecondaryIndexobject, usually it is a class attribute of yourModelattribute.
New in version 5.3.4.6.
- classmethod iter_query_index(index: Union[GlobalSecondaryIndex, LocalSecondaryIndex], hash_key: Any, range_key_condition: Optional[Condition] = None, filter_condition: Optional[Condition] = None, consistent_read: Optional[bool] = False, scan_index_forward: Optional[bool] = None, limit: Optional[int] = None, last_evaluated_key: Optional[Dict[str, Dict[str, Any]]] = None, attributes_to_get: Optional[List[str]] = None, page_size: Optional[int] = None, rate_limit: Optional[float] = None) IterProxy[_T][source]#
Similar to the
Index.scan()method, but it returns a more user-friendly iterator with type hint.- Parameters:
index – the
GlobalSecondaryIndexorLocalSecondaryIndexobject, usually it is a class attribute of yourModelattribute.
New in version 5.3.4.6.