| |
- __builtin__.list(__builtin__.object)
-
- QueryableList.Base.QueryableListBase
-
- QueryableListDicts
- QueryableListMixed
- QueryableListObjs
- __builtin__.object
-
- QueryableList.Builder.QueryBuilder
class QueryBuilder(__builtin__.object) |
|
QueryBuilder - Build a reusable query that can be applied on multiple lists, or appended
by several methods. |
|
Methods defined here:
- __init__(self)
- addFilter(self, filterMethod='AND', **kwargs)
- addFilter - Add a filter to this query.
@param filterMethod <str> - The filter method to use (AND or OR), default: 'AND'
@param additional args - Filter arguments. @see QueryableListBase.filter
@raises ValueError if filterMethod is not one of known methods.
- copy(self)
- copy - Create a copy of this query.
@return <QueryBuilder> - a copy of this query
- execute(self, lst)
- execute - Execute the series of filters, in order, on the provided list.
@param lst <list/ A QueryableList type> - The list to filter. If you already know the types of items within
the list, you can pick a QueryableList implementing class to get faster results. Otherwise, if a list type that does
not extend QueryableListBase is provided, QueryableListMixed will be used (Supports both object-like and dict-like items)
@return - QueryableList of results. If you provided #lst as a QueryableList type already, that same type will be returned.
Otherwise, a QueryableListMixed will be returned.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class QueryableListBase(__builtin__.list) |
|
QueryableListBase - The base implementation of a QueryableList.
Any implementing classes should only have to implement the "_get_item_value(item, fieldName)" method, to return the value of a given field on an item.
You cannot use this directly, instead use one of the implementing classes (like QueryableListDicts or QueryableListObjs), or your own implementing class. |
|
- Method resolution order:
- QueryableListBase
- __builtin__.list
- __builtin__.object
Methods defined here:
- __add__(self, other)
- __and__(self, other)
- __getslice__(self, start, end)
- __iadd__(self, other)
- __or__(self, other)
- __repr__(self)
- __sub__(self, other)
- __xor__(self, other)
- all(self)
- filter = filterAnd(self, **kwargs)
- filterAnd(self, **kwargs)
- filter/filterAnd - Performs a filter and returns a QueryableList object of the same type.
All the provided filters must match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
- filterOr(self, **kwargs)
- filterOr - Performs a filter and returns a QueryableList object of the same type.
Anythe provided filters can match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from __builtin__.list:
- __contains__(...)
- x.__contains__(y) <==> y in x
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __delslice__(...)
- x.__delslice__(i, j) <==> del x[i:j]
Use of negative indices is not supported.
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(...)
- x.__gt__(y) <==> x>y
- __imul__(...)
- x.__imul__(y) <==> x*=y
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __reversed__(...)
- L.__reversed__() -- return a reverse iterator over the list
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- __setslice__(...)
- x.__setslice__(i, j, y) <==> x[i:j]=y
Use of negative indices is not supported.
- __sizeof__(...)
- L.__sizeof__() -- size of L in memory, in bytes
- append(...)
- L.append(object) -- append object to end
- count(...)
- L.count(value) -> integer -- return number of occurrences of value
- extend(...)
- L.extend(iterable) -- extend list by appending elements from the iterable
- index(...)
- L.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
- insert(...)
- L.insert(index, object) -- insert object before index
- pop(...)
- L.pop([index]) -> item -- remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- remove(...)
- L.remove(value) -- remove first occurrence of value.
Raises ValueError if the value is not present.
- reverse(...)
- L.reverse() -- reverse *IN PLACE*
- sort(...)
- L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1
Data and other attributes inherited from __builtin__.list:
- __hash__ = None
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class QueryableListDicts(QueryableList.Base.QueryableListBase) |
|
QueryableListDicts - QueryableList where each item is or extends dict (or implements __getitem__ and __contains__) |
|
- Method resolution order:
- QueryableListDicts
- QueryableList.Base.QueryableListBase
- __builtin__.list
- __builtin__.object
Methods inherited from QueryableList.Base.QueryableListBase:
- __add__(self, other)
- __and__(self, other)
- __getslice__(self, start, end)
- __iadd__(self, other)
- __or__(self, other)
- __repr__(self)
- __sub__(self, other)
- __xor__(self, other)
- all(self)
- filter = filterAnd(self, **kwargs)
- filter/filterAnd - Performs a filter and returns a QueryableList object of the same type.
All the provided filters must match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
- filterAnd(self, **kwargs)
- filter/filterAnd - Performs a filter and returns a QueryableList object of the same type.
All the provided filters must match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
- filterOr(self, **kwargs)
- filterOr - Performs a filter and returns a QueryableList object of the same type.
Anythe provided filters can match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
Data descriptors inherited from QueryableList.Base.QueryableListBase:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from __builtin__.list:
- __contains__(...)
- x.__contains__(y) <==> y in x
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __delslice__(...)
- x.__delslice__(i, j) <==> del x[i:j]
Use of negative indices is not supported.
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(...)
- x.__gt__(y) <==> x>y
- __imul__(...)
- x.__imul__(y) <==> x*=y
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __reversed__(...)
- L.__reversed__() -- return a reverse iterator over the list
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- __setslice__(...)
- x.__setslice__(i, j, y) <==> x[i:j]=y
Use of negative indices is not supported.
- __sizeof__(...)
- L.__sizeof__() -- size of L in memory, in bytes
- append(...)
- L.append(object) -- append object to end
- count(...)
- L.count(value) -> integer -- return number of occurrences of value
- extend(...)
- L.extend(iterable) -- extend list by appending elements from the iterable
- index(...)
- L.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
- insert(...)
- L.insert(index, object) -- insert object before index
- pop(...)
- L.pop([index]) -> item -- remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- remove(...)
- L.remove(value) -- remove first occurrence of value.
Raises ValueError if the value is not present.
- reverse(...)
- L.reverse() -- reverse *IN PLACE*
- sort(...)
- L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1
Data and other attributes inherited from __builtin__.list:
- __hash__ = None
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class QueryableListMixed(QueryableList.Base.QueryableListBase) |
|
QueryableListMixed - QueryableList which can contain dict-like items or object-like items
This is somewhat slower than using QueryableListObjs or QueryableListDicts directly, but use it if you need to mix, or need to support either type. |
|
- Method resolution order:
- QueryableListMixed
- QueryableList.Base.QueryableListBase
- __builtin__.list
- __builtin__.object
Methods inherited from QueryableList.Base.QueryableListBase:
- __add__(self, other)
- __and__(self, other)
- __getslice__(self, start, end)
- __iadd__(self, other)
- __or__(self, other)
- __repr__(self)
- __sub__(self, other)
- __xor__(self, other)
- all(self)
- filter = filterAnd(self, **kwargs)
- filter/filterAnd - Performs a filter and returns a QueryableList object of the same type.
All the provided filters must match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
- filterAnd(self, **kwargs)
- filter/filterAnd - Performs a filter and returns a QueryableList object of the same type.
All the provided filters must match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
- filterOr(self, **kwargs)
- filterOr - Performs a filter and returns a QueryableList object of the same type.
Anythe provided filters can match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
Data descriptors inherited from QueryableList.Base.QueryableListBase:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from __builtin__.list:
- __contains__(...)
- x.__contains__(y) <==> y in x
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __delslice__(...)
- x.__delslice__(i, j) <==> del x[i:j]
Use of negative indices is not supported.
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(...)
- x.__gt__(y) <==> x>y
- __imul__(...)
- x.__imul__(y) <==> x*=y
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __reversed__(...)
- L.__reversed__() -- return a reverse iterator over the list
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- __setslice__(...)
- x.__setslice__(i, j, y) <==> x[i:j]=y
Use of negative indices is not supported.
- __sizeof__(...)
- L.__sizeof__() -- size of L in memory, in bytes
- append(...)
- L.append(object) -- append object to end
- count(...)
- L.count(value) -> integer -- return number of occurrences of value
- extend(...)
- L.extend(iterable) -- extend list by appending elements from the iterable
- index(...)
- L.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
- insert(...)
- L.insert(index, object) -- insert object before index
- pop(...)
- L.pop([index]) -> item -- remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- remove(...)
- L.remove(value) -- remove first occurrence of value.
Raises ValueError if the value is not present.
- reverse(...)
- L.reverse() -- reverse *IN PLACE*
- sort(...)
- L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1
Data and other attributes inherited from __builtin__.list:
- __hash__ = None
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class QueryableListObjs(QueryableList.Base.QueryableListBase) |
|
QueryableListObjs - QueryableList where each item extends object (or implements __getattribute__) |
|
- Method resolution order:
- QueryableListObjs
- QueryableList.Base.QueryableListBase
- __builtin__.list
- __builtin__.object
Methods inherited from QueryableList.Base.QueryableListBase:
- __add__(self, other)
- __and__(self, other)
- __getslice__(self, start, end)
- __iadd__(self, other)
- __or__(self, other)
- __repr__(self)
- __sub__(self, other)
- __xor__(self, other)
- all(self)
- filter = filterAnd(self, **kwargs)
- filter/filterAnd - Performs a filter and returns a QueryableList object of the same type.
All the provided filters must match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
- filterAnd(self, **kwargs)
- filter/filterAnd - Performs a filter and returns a QueryableList object of the same type.
All the provided filters must match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
- filterOr(self, **kwargs)
- filterOr - Performs a filter and returns a QueryableList object of the same type.
Anythe provided filters can match for the item to be returned.
@params are in the format of fieldName__operation=value where fieldName is the name of the field on any given item, "operation" is one of the given operations (@see main documentation) (e.x. eq, ne, isnull), and value is what is used in the operation.
@return - A QueryableList object of the same type, with only the matching objects returned.
Data descriptors inherited from QueryableList.Base.QueryableListBase:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from __builtin__.list:
- __contains__(...)
- x.__contains__(y) <==> y in x
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __delslice__(...)
- x.__delslice__(i, j) <==> del x[i:j]
Use of negative indices is not supported.
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(...)
- x.__gt__(y) <==> x>y
- __imul__(...)
- x.__imul__(y) <==> x*=y
- __init__(...)
- x.__init__(...) initializes x; see help(type(x)) for signature
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __reversed__(...)
- L.__reversed__() -- return a reverse iterator over the list
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- __setslice__(...)
- x.__setslice__(i, j, y) <==> x[i:j]=y
Use of negative indices is not supported.
- __sizeof__(...)
- L.__sizeof__() -- size of L in memory, in bytes
- append(...)
- L.append(object) -- append object to end
- count(...)
- L.count(value) -> integer -- return number of occurrences of value
- extend(...)
- L.extend(iterable) -- extend list by appending elements from the iterable
- index(...)
- L.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
- insert(...)
- L.insert(index, object) -- insert object before index
- pop(...)
- L.pop([index]) -> item -- remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- remove(...)
- L.remove(value) -- remove first occurrence of value.
Raises ValueError if the value is not present.
- reverse(...)
- L.reverse() -- reverse *IN PLACE*
- sort(...)
- L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1
Data and other attributes inherited from __builtin__.list:
- __hash__ = None
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
| |