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

Class BinaryConstraint

source code

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

Constraints which have an operator and a value

These constraints assert a relationship between the value represented by the path (it must be a representation of a value, ie an Attribute) and another value - ie. the operator takes two parameters.

In all case the 'left' side of the relationship is the path, and the 'right' side is the supplied value.

Valid operators are:

Instance Methods [hide private]
 
__init__(self, path, op, value, 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__, get_codes

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(['!=', '<', '<=', '=', '>', '>=', 'CONTAINS', 'LIKE'...

Inherited from Constraint: child_type

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

Constructor

Parameters:
  • path (string) - The path to constrain
  • op (string) - The relationship between the value represented by the path and the value provided (must be a valid operator)
  • value (string or number) - The value to compare the stored value to
  • 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

Class Variable Details [hide private]

OPS

Value:
set(['!=', '<', '<=', '=', '>', '>=', 'CONTAINS', 'LIKE', 'NOT LIKE'])