def __get_table_keys()

in modular_sdk/models/pynamodb_extension/pynamodb_to_pymongo_adapter.py [0:0]


    def __get_table_keys(model_class) -> tuple:
        short_to_body_mapping = {attr_body.attr_name: attr_body
                                 for attr_name, attr_body in
                                 model_class._attributes.items()}
        hash_key_name = None
        range_key_name = None
        for short_name, body in short_to_body_mapping.items():
            if body.is_hash_key:
                hash_key_name = short_name
                continue
            if body.is_range_key:
                range_key_name = short_name
                continue
        return hash_key_name, range_key_name