コード例 #1
0
 def __init__(self, attribute_or_path):
     from pynamodb.attributes import Attribute  # prevent circular import -- Attribute imports Path
     is_attribute = isinstance(attribute_or_path, Attribute)
     self.attribute = attribute_or_path if is_attribute else None
     self.short_attr_type = ATTR_TYPE_MAP[attribute_or_path.attr_type] if is_attribute else None
     path = attribute_or_path.attr_path if is_attribute else attribute_or_path
     if not path:
         raise ValueError("path cannot be empty")
     super(Path, self).__init__(get_path_segments(path))
コード例 #2
0
ファイル: operand.py プロジェクト: jlafon/PynamoDB
 def __init__(self, attribute_or_path):
     from pynamodb.attributes import Attribute  # prevent circular import -- Attribute imports Path
     is_attribute = isinstance(attribute_or_path, Attribute)
     self.attribute = attribute_or_path if is_attribute else None
     self.short_attr_type = ATTR_TYPE_MAP[attribute_or_path.attr_type] if is_attribute else None
     path = attribute_or_path.attr_path if is_attribute else attribute_or_path
     if not path:
         raise ValueError("path cannot be empty")
     super(Path, self).__init__(get_path_segments(path))
コード例 #3
0
ファイル: operand.py プロジェクト: samanamp/releasechannel
 def __init__(self, attribute_or_path: Union['Attribute', str, List[str]]) -> None:
     from pynamodb.attributes import Attribute  # prevent circular import -- Attribute imports Path
     path: Union[str, List[str]]
     if isinstance(attribute_or_path, Attribute):
         self.attribute = attribute_or_path
         self.attr_type = attribute_or_path.attr_type
         path = attribute_or_path.attr_path
     else:
         self.attribute = None
         self.attr_type = None
         path = attribute_or_path
     if not path:
         raise ValueError("path cannot be empty")
     super(Path, self).__init__(get_path_segments(path))
コード例 #4
0
ファイル: operand.py プロジェクト: eukaryote/PynamoDB
 def __init__(self, path):
     if not path:
         raise ValueError("path cannot be empty")
     self.path = get_path_segments(path)
コード例 #5
0
ファイル: operand.py プロジェクト: eukaryote/PynamoDB
 def __init__(self, path):
     if not path:
         raise ValueError("path cannot be empty")
     self.path = get_path_segments(path)