コード例 #1
0
ファイル: _model.py プロジェクト: Waynelemars/flocker
 def key_match_invariant(pmap):
     for (key, value) in pmap.items():
         if key != getattr(value, attribute):
             return (
                 False, "{} is not correct key for {}".format(key, value)
             )
     return (True, "")
コード例 #2
0
ファイル: _model.py プロジェクト: moypray/flocker
    def key_match_invariant(pmap):
        # Either the field allows None, in which case this is necessary,
        # or it doesn't in which case this won't do any harm since
        # invalidity of None will be enforced elsewhere:
        if pmap is None:
            return (True, "")

        for (key, value) in pmap.items():
            if key != getattr(value, attribute):
                return (False,
                        "{} is not correct key for {}".format(key, value))
        return (True, "")
コード例 #3
0
ファイル: _model.py プロジェクト: 332054781/flocker
    def key_match_invariant(pmap):
        # Either the field allows None, in which case this is necessary,
        # or it doesn't in which case this won't do any harm since
        # invalidity of None will be enforced elsewhere:
        if pmap is None:
            return (True, "")

        for (key, value) in pmap.items():
            if key != getattr(value, attribute):
                return (
                    False, "{} is not correct key for {}".format(key, value)
                )
        return (True, "")
コード例 #4
0
ファイル: _model.py プロジェクト: ruo91/flocker
 def key_match_invariant(pmap):
     for (key, value) in pmap.items():
         if key != getattr(value, attribute):
             return (False,
                     "{} is not correct key for {}".format(key, value))
     return (True, "")