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

Class MultiConstraint

source code

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

Constraints for checking membership of a set of values

These constraints require the value they constrain to be either a member of a set of values, or not a member.

Valid operators:

These constraints are similar in use to List constraints, with the following differences:

Instance Methods [hide private]
 
__init__(self, path, op, values, 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(['NONE OF', 'ONE OF'])

Inherited from Constraint: child_type

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

Constructor

Parameters:
  • path (string) - The path to constrain. Here it must be an attribute of some object.
  • op (string) - The relationship between the path and the path provided (must be a valid operator)
  • values - The set of values which the object of the constraint either must or must not belong to.
  • code (string) - The code for this constraint (default = "A")
  • value (string)
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