Package intermine :: Module constraints :: Class TernaryConstraint
[hide private]
[frames] | no frames]

Class TernaryConstraint

source code

              object --+                
                       |                
pathfeatures.PathFeature --+            
                           |            
                  Constraint --+        
                               |        
                  object --+   |        
                           |   |        
                   LogicNode --+        
                               |        
                 CodedConstraint --+    
                                   |    
                    BinaryConstraint --+
                                       |
                                      TernaryConstraint
Known Subclasses:

Constraints for broad, general searching over all fields

These constraints request a wide-ranging search for matching fields over all aspects of an object, including up to coercion from related classes.

Valid operators:

To aid disambiguation, Ternary constaints accept an extra_value as well as the main value.

Instance Methods [hide private]
 
__init__(self, path, op, value, extra_value=None, code='A') source code
 
to_string(self)
Provide a human readable representation of the logic.
source code
 
to_dict(self)
Return a dict object which can be used to construct a DOM element with the appropriate attributes.
source code

Inherited from CodedConstraint: __str__

Inherited from pathfeatures.PathFeature: __repr__

Inherited from LogicNode: __add__, __and__, __or__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Class Variables [hide private]
  OPS = set(['LOOKUP'])

Inherited from Constraint: child_type

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, path, op, value, extra_value=None, code='A')
(Constructor)

source code 

Constructor

Parameters:
  • path (string) - The path to constrain. Here is must be a class, or a reference to a class.
  • op (string) - The relationship between the path and the path provided (must be a valid operator)
  • value (string) - The value to check other fields against.
  • extra_value (string) - A further value for disambiguation. The meaning of this value varies by class and configuration. For example, if the class of the object is Gene, then extra_value will refer to the Organism.
  • code (string) - The code for this constraint (default = "A")
Overrides: object.__init__

to_string(self)

source code 

Provide a human readable representation of the logic. This method is called by repr.

Overrides: pathfeatures.PathFeature.to_string

to_dict(self)

source code 

Return a dict object which can be used to construct a DOM element with the appropriate attributes.

Overrides: pathfeatures.PathFeature.to_dict