Previous topic

oyProjectManager.core.models.VersionableBase

Next topic

oyProjectManager.core.models.VersionType

This Page

oyProjectManager.core.models.VersionStatusComparator

Inheritance diagram of oyProjectManager.core.models.VersionStatusComparator

class oyProjectManager.core.models.VersionStatusComparator(expression)[source]

Bases: str, sqlalchemy.ext.hybrid.Comparator

The comparator class for Version.status

__init__(expression)

Methods

__init__(expression)
adapted(adapter)
any([criterion]) Return true if this collection contains any member that meets the given criterion.
any_op(a, b, **kwargs)
asc() Produce a asc() clause against the
between(cleft, cright) Produce a between() clause against
capitalize(() -> string) Return a copy of the string S with only its first character
center((width[, fillchar]) -> string) Return S centered in a string of length width. Padding is
collate(collation) Produce a collate() clause against
concat(other) Implement the ‘concat’ operator.
contains(other, **kwargs) Implement the ‘contains’ operator.
count((sub[, start[, end]]) -> int) Return the number of non-overlapping occurrences of substring sub in
decode(([encoding[,errors]]) -> object) Decodes S using the codec registered for encoding. encoding defaults
desc() Produce a desc() clause against the
distinct() Produce a distinct() clause against the parent object.
encode(([encoding[,errors]]) -> object) Encodes S using the codec registered for encoding. encoding defaults
endswith((suffix[, start[, end]]) -> bool) Return True if S ends with the specified suffix, False otherwise.
expandtabs(([tabsize]) -> string) Return a copy of S where all tab characters are expanded using spaces.
find((sub [,start [,end]]) -> int) Return the lowest index in S where substring sub is found,
format((*args, **kwargs) -> string) Return a formatted version of S, using substitutions from args and kwargs.
has([criterion]) Return true if this element references a member which meets the given criterion.
has_op(a, b, **kwargs)
ilike(other[, escape]) Implement the ilike operator.
in_(other) Implement the in operator.
index((sub [,start [,end]]) -> int) Like S.find() but raise ValueError when the substring is not found.
isalnum(() -> bool) Return True if all characters in S are alphanumeric
isalpha(() -> bool) Return True if all characters in S are alphabetic
isdigit(() -> bool) Return True if all characters in S are digits
islower(() -> bool) Return True if all cased characters in S are lowercase and there is
isspace(() -> bool) Return True if all characters in S are whitespace
istitle(() -> bool) Return True if S is a titlecased string and there is at least one
isupper(() -> bool) Return True if all cased characters in S are uppercase and there is
join((iterable) -> string) Return a string which is the concatenation of the strings in the iterable.
like(other[, escape]) Implement the like operator.
ljust((width[, fillchar]) -> string) Return S left-justified in a string of length width. Padding is
lower(() -> string) Return a copy of the string S converted to lowercase.
lstrip(([chars]) -> string or unicode) Return a copy of the string S with leading whitespace removed.
match(other, **kwargs) Implements the ‘match’ operator.
nullsfirst() Produce a nullsfirst() clause against the
nullslast() Produce a nullslast() clause against the
of_type(class_) Redefine this object in terms of a polymorphic subclass.
of_type_op(a, class_)
op(opstring) produce a generic operator function.
operate(op, *other, **kwargs) Operate on an argument.
partition(sep) -> (head, sep, tail) Search for the separator sep in S, and return the part before it,
replace((old, new[, count]) -> string) Return a copy of string S with all occurrences of substring
reverse_operate(op, other, **kwargs) Reverse operate on an argument.
rfind((sub [,start [,end]]) -> int) Return the highest index in S where substring sub is found,
rindex((sub [,start [,end]]) -> int) Like S.rfind() but raise ValueError when the substring is not found.
rjust((width[, fillchar]) -> string) Return S right-justified in a string of length width. Padding is
rpartition(sep) -> (head, sep, tail) Search for the separator sep in S, starting at the end of S, and return
rsplit(([sep [,maxsplit]]) -> list of strings) Return a list of the words in the string S, using sep as the
rstrip(([chars]) -> string or unicode) Return a copy of the string S with trailing whitespace removed.
split(([sep [,maxsplit]]) -> list of strings) Return a list of the words in the string S, using sep as the
splitlines(([keepends]) -> list of strings) Return a list of the lines in S, breaking at line boundaries.
startswith((prefix[, start[, end]]) -> bool) Return True if S starts with the specified prefix, False otherwise.
strip(([chars]) -> string or unicode) Return a copy of the string S with leading and trailing
swapcase(() -> string) Return a copy of the string S with uppercase characters
title(() -> string) Return a titlecased version of S, i.e. words start with uppercase
translate((table [,deletechars]) -> string) Return a copy of the string S, where all characters occurring
upper(() -> string) Return a copy of the string S converted to uppercase.
zfill((width) -> string) Pad a numeric string S with zeros on the left, to fill a field

Attributes

timetuple
any(criterion=None, **kwargs)

Return true if this collection contains any member that meets the given criterion.

The usual implementation of any() is RelationshipProperty.Comparator.any().

Parameters:
  • criterion – an optional ClauseElement formulated against the member class’ table or attributes.
  • **kwargs – key/value pairs corresponding to member class attribute names which will be compared via equality to the corresponding values.
asc()

Produce a asc() clause against the parent object.

between(cleft, cright)

Produce a between() clause against the parent object, given the lower and upper range.

capitalize() → string

Return a copy of the string S with only its first character capitalized.

center(width[, fillchar]) → string

Return S centered in a string of length width. Padding is done using the specified fill character (default is a space)

collate(collation)

Produce a collate() clause against the parent object, given the collation string.

concat(other)

Implement the ‘concat’ operator.

In a column context, produces the clause a || b, or uses the concat() operator on MySQL.

contains(other, **kwargs)

Implement the ‘contains’ operator.

In a column context, produces the clause LIKE '%<other>%'

count(sub[, start[, end]]) → int

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

decode([encoding[, errors]]) → object

Decodes S using the codec registered for encoding. encoding defaults to the default encoding. errors may be given to set a different error handling scheme. Default is ‘strict’ meaning that encoding errors raise a UnicodeDecodeError. Other possible values are ‘ignore’ and ‘replace’ as well as any other name registered with codecs.register_error that is able to handle UnicodeDecodeErrors.

desc()

Produce a desc() clause against the parent object.

distinct()

Produce a distinct() clause against the parent object.

encode([encoding[, errors]]) → object

Encodes S using the codec registered for encoding. encoding defaults to the default encoding. errors may be given to set a different error handling scheme. Default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that is able to handle UnicodeEncodeErrors.

endswith(suffix[, start[, end]]) → bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs([tabsize]) → string

Return a copy of S where all tab characters are expanded using spaces. If tabsize is not given, a tab size of 8 characters is assumed.

find(sub[, start[, end]]) → int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format(*args, **kwargs) → string

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{‘ and ‘}’).

has(criterion=None, **kwargs)

Return true if this element references a member which meets the given criterion.

The usual implementation of has() is RelationshipProperty.Comparator.has().

Parameters:
  • criterion – an optional ClauseElement formulated against the member class’ table or attributes.
  • **kwargs – key/value pairs corresponding to member class attribute names which will be compared via equality to the corresponding values.
ilike(other, escape=None)

Implement the ilike operator.

In a column context, produces the clause a ILIKE other.

in_(other)

Implement the in operator.

In a column context, produces the clause a IN other. “other” may be a tuple/list of column expressions, or a select() construct.

index(sub[, start[, end]]) → int

Like S.find() but raise ValueError when the substring is not found.

isalnum() → bool

Return True if all characters in S are alphanumeric and there is at least one character in S, False otherwise.

isalpha() → bool

Return True if all characters in S are alphabetic and there is at least one character in S, False otherwise.

isdigit() → bool

Return True if all characters in S are digits and there is at least one character in S, False otherwise.

islower() → bool

Return True if all cased characters in S are lowercase and there is at least one cased character in S, False otherwise.

isspace() → bool

Return True if all characters in S are whitespace and there is at least one character in S, False otherwise.

istitle() → bool

Return True if S is a titlecased string and there is at least one character in S, i.e. uppercase characters may only follow uncased characters and lowercase characters only cased ones. Return False otherwise.

isupper() → bool

Return True if all cased characters in S are uppercase and there is at least one cased character in S, False otherwise.

join(iterable) → string

Return a string which is the concatenation of the strings in the iterable. The separator between elements is S.

like(other, escape=None)

Implement the like operator.

In a column context, produces the clause a LIKE other.

ljust(width[, fillchar]) → string

Return S left-justified in a string of length width. Padding is done using the specified fill character (default is a space).

lower() → string

Return a copy of the string S converted to lowercase.

lstrip([chars]) → string or unicode

Return a copy of the string S with leading whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is unicode, S will be converted to unicode before stripping

match(other, **kwargs)

Implements the ‘match’ operator.

In a column context, this produces a MATCH clause, i.e. MATCH '<other>'. The allowed contents of other are database backend specific.

nullsfirst()

Produce a nullsfirst() clause against the parent object.

nullslast()

Produce a nullslast() clause against the parent object.

of_type(class_)

Redefine this object in terms of a polymorphic subclass.

Returns a new PropComparator from which further criterion can be evaluated.

e.g.:

query.join(Company.employees.of_type(Engineer)).\
   filter(Engineer.name=='foo')
Parameters:class_ – a class or mapper indicating that criterion will be against this specific subclass.
op(opstring)

produce a generic operator function.

e.g.:

somecolumn.op("*")(5)

produces:

somecolumn * 5
Parameters:operator – a string which will be output as the infix operator between this ClauseElement and the expression passed to the generated function.

This function can also be used to make bitwise operators explicit. For example:

somecolumn.op('&')(0xff)

is a bitwise AND of the value in somecolumn.

operate(op, *other, **kwargs)

Operate on an argument.

This is the lowest level of operation, raises NotImplementedError by default.

Overriding this on a subclass can allow common behavior to be applied to all operations. For example, overriding ColumnOperators to apply func.lower() to the left and right side:

class MyComparator(ColumnOperators):
    def operate(self, op, other):
        return op(func.lower(self), func.lower(other))
Parameters:
  • op – Operator callable.
  • *other – the ‘other’ side of the operation. Will be a single scalar for most operations.
  • **kwargs – modifiers. These may be passed by special operators such as ColumnOperators.contains().
partition(sep) -> (head, sep, tail)

Search for the separator sep in S, and return the part before it, the separator itself, and the part after it. If the separator is not found, return S and two empty strings.

replace(old, new[, count]) → string

Return a copy of string S with all occurrences of substring old replaced by new. If the optional argument count is given, only the first count occurrences are replaced.

reverse_operate(op, other, **kwargs)

Reverse operate on an argument.

Usage is the same as operate().

rfind(sub[, start[, end]]) → int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex(sub[, start[, end]]) → int

Like S.rfind() but raise ValueError when the substring is not found.

rjust(width[, fillchar]) → string

Return S right-justified in a string of length width. Padding is done using the specified fill character (default is a space)

rpartition(sep) -> (head, sep, tail)

Search for the separator sep in S, starting at the end of S, and return the part before it, the separator itself, and the part after it. If the separator is not found, return two empty strings and S.

rsplit([sep[, maxsplit]]) → list of strings

Return a list of the words in the string S, using sep as the delimiter string, starting at the end of the string and working to the front. If maxsplit is given, at most maxsplit splits are done. If sep is not specified or is None, any whitespace string is a separator.

rstrip([chars]) → string or unicode

Return a copy of the string S with trailing whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is unicode, S will be converted to unicode before stripping

split([sep[, maxsplit]]) → list of strings

Return a list of the words in the string S, using sep as the delimiter string. If maxsplit is given, at most maxsplit splits are done. If sep is not specified or is None, any whitespace string is a separator and empty strings are removed from the result.

splitlines([keepends]) → list of strings

Return a list of the lines in S, breaking at line boundaries. Line breaks are not included in the resulting list unless keepends is given and true.

startswith(prefix[, start[, end]]) → bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip([chars]) → string or unicode

Return a copy of the string S with leading and trailing whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is unicode, S will be converted to unicode before stripping

swapcase() → string

Return a copy of the string S with uppercase characters converted to lowercase and vice versa.

title() → string

Return a titlecased version of S, i.e. words start with uppercase characters, all remaining cased characters have lowercase.

translate(table[, deletechars]) → string

Return a copy of the string S, where all characters occurring in the optional argument deletechars are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256 or None. If the table argument is None, no translation is applied and the operation simply removes the characters in deletechars.

upper() → string

Return a copy of the string S converted to uppercase.

zfill(width) → string

Pad a numeric string S with zeros on the left, to fill a field of the specified width. The string S is never truncated.