everest.querying.specifications

Specifications.

This file is part of the everest project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.

The central idea of a Specification is to separate the statement of how to match a candidate from the candidate object that it is matched against.

class everest.querying.specifications.CompositeFilterSpecification(left_spec, right_spec)[source]

Bases: everest.querying.specifications.FilterSpecification

Abstract base class for specifications that are composed of two other specifications.

__init__(left_spec, right_spec)[source]

Constructs a CompositeFilterSpecification

Parameters:
class everest.querying.specifications.ConjunctionFilterSpecification(left_spec, right_spec)[source]

Bases: everest.querying.specifications.CompositeFilterSpecification

Concrete conjuction specification.

class everest.querying.specifications.CriterionFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.LeafFilterSpecification

Abstract base class for specifications representing filter criteria.

__init__(attr_name, attr_value)[source]

Constructs a filter specification for a query criterion.

Parameters:
  • operator (everest.querying.operators.Operator) – operator
  • attr_name (str) – the candidate’s attribute name
  • attr_value – the value that satisfies the specification
class everest.querying.specifications.DisjuctionFilterSpecification(left_spec, right_spec)[source]

Bases: everest.querying.specifications.CompositeFilterSpecification

Concrete disjuction specification.

class everest.querying.specifications.FilterSpecification[source]

Bases: everest.querying.base.Specification

Abstract base class for all filter specifications.

and_(other)[source]

Generative method to create a ConjunctionFilterSpecification.

Parameters:other (FilterSpecification) – the other specification
Returns:a new conjuction specification
Return type:ConjunctionFilterSpecification
is_satisfied_by(candidate)[source]

Tells if the given candidate object matches this specification.

Parameters:candidate (object) – the candidate object
Returns:True if the specification is met by the candidate.
Return type:bool
not_()[source]

Generative method to create a NegationFilterSpecification

Returns:a new negation specification
Return type:NegationFilterSpecification
or_(other)[source]

Generative method to create a DisjuctionFilterSpecification

Parameters:other (FilterSpecification) – the other specification
Returns:a new disjuction specification
Return type:DisjuctionFilterSpecification
class everest.querying.specifications.FilterSpecificationFactory[source]

Bases: object

Filter specification factory.

__weakref__

list of weak references to the object (if defined)

class everest.querying.specifications.LeafFilterSpecification[source]

Bases: everest.querying.specifications.FilterSpecification

Abstract base class for specifications that represent leaves in a specification tree.

class everest.querying.specifications.NaturalOrderSpecification(attr_name)[source]

Bases: everest.querying.specifications.ObjectOrderSpecification

See http://www.codinghorror.com/blog/2007/12/sorting-for-humans-natural-sort-order.html

class everest.querying.specifications.NegationFilterSpecification(wrapped_spec)[source]

Bases: everest.querying.specifications.FilterSpecification

Concrete negation specification.

__eq__(other)[source]

Equality operator

__init__(wrapped_spec)[source]

Constructs a NegationFilterSpecification

Parameters:wrapped (FilterSpecification) – the wrapped specification
__ne__(other)[source]

Inequality operator

class everest.querying.specifications.OrderSpecificationFactory[source]

Bases: object

Order specification factory.

__weakref__

list of weak references to the object (if defined)

class everest.querying.specifications.ValueContainedFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.CriterionFilterSpecification

Concrete value contained in a list of values specification

class everest.querying.specifications.ValueContainsFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.CriterionFilterSpecification

Concrete value contains specification

class everest.querying.specifications.ValueEndsWithFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.CriterionFilterSpecification

Concrete value ends with specification

class everest.querying.specifications.ValueEqualToFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.CriterionFilterSpecification

Concrete value equal to specification

class everest.querying.specifications.ValueGreaterThanFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.CriterionFilterSpecification

Concrete value greater than specification

class everest.querying.specifications.ValueGreaterThanOrEqualToFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.CriterionFilterSpecification

Concrete value greater than or equal to specification

class everest.querying.specifications.ValueInRangeFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.CriterionFilterSpecification

Concrete specification for a range of values

class everest.querying.specifications.ValueLessThanFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.CriterionFilterSpecification

Concrete value less than specification

class everest.querying.specifications.ValueLessThanOrEqualToFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.CriterionFilterSpecification

Concrete value less than or equal to specification

class everest.querying.specifications.ValueStartsWithFilterSpecification(attr_name, attr_value)[source]

Bases: everest.querying.specifications.CriterionFilterSpecification

Concrete value starts with specification

Project Versions

Previous topic

everest.querying.orderparser

Next topic

everest.querying.utils

This Page