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

Class CodedConstraint

source code

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

A parent class for all constraints that have codes

Constraints that have codes are the principal logical filters on queries, and need to be refered to individually (hence the codes). They will all have a logical operation they embody, and so have a reference to an operator.

This class is not meant to be instantiated directly, but instead inherited from to supply default behaviour.

Instance Methods [hide private]
 
__init__(self, path, op, code='A') source code
 
__str__(self)
Stringify to the code they are refered to by.
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 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([])

Inherited from Constraint: child_type

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

Constructor

Parameters:
  • path (string) - The path to constrain
  • op (string) - The operation to apply - must be in the OPS set
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

Stringify to the code they are refered to by.

Overrides: object.__str__

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