QueryableList.Base
index

# Copyright (c) 2016 Timothy Savannah under the terms of the GNU Lesser General Public License version 2.1.
#  You should have received a copy of this as "LICENSE" with this source distribution. The full license is available at https://raw.githubusercontent.com/kata198/QueryableList/master/LICENSE

 
Modules
       
re

 
Classes
       
builtins.list(builtins.object)
QueryableListBase

 
class QueryableListBase(builtins.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
builtins.list
builtins.object

Methods defined here:
__add__(self, other)
Return self+value.
__and__(self, other)
__getslice__(self, start, end)
__iadd__(self, other)
Implement self+=value.
__or__(self, other)
__repr__(self)
Return 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 builtins.list:
__contains__(self, key, /)
Return key in self.
__delitem__(self, key, /)
Delete self[key].
__eq__(self, value, /)
Return self==value.
__ge__(self, value, /)
Return self>=value.
__getattribute__(self, name, /)
Return getattr(self, name).
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(self, value, /)
Return self>value.
__imul__(self, value, /)
Implement self*=value.
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__iter__(self, /)
Implement iter(self).
__le__(self, value, /)
Return self<=value.
__len__(self, /)
Return len(self).
__lt__(self, value, /)
Return self<value.
__mul__(self, value, /)
Return self*value.n
__ne__(self, value, /)
Return self!=value.
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.
__reversed__(...)
L.__reversed__() -- return a reverse iterator over the list
__rmul__(self, value, /)
Return self*value.
__setitem__(self, key, value, /)
Set self[key] to value.
__sizeof__(...)
L.__sizeof__() -- size of L in memory, in bytes
append(...)
L.append(object) -> None -- append object to end
clear(...)
L.clear() -> None -- remove all items from L
copy(...)
L.copy() -> list -- a shallow copy of L
count(...)
L.count(value) -> integer -- return number of occurrences of value
extend(...)
L.extend(iterable) -> None -- 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) -> None -- remove first occurrence of value.
Raises ValueError if the value is not present.
reverse(...)
L.reverse() -- reverse *IN PLACE*
sort(...)
L.sort(key=None, reverse=False) -> None -- stable sort *IN PLACE*

Data and other attributes inherited from builtins.list:
__hash__ = None

 
Functions
       
getFiltersFromArgs(kwargs)
getFiltersFromArgs - Returns a dictionary of each filter type, and the corrosponding field/value
 
@param kwargs <dict> - Dictionary of filter arguments
 
 
@return - Dictionary of each filter type (minus the ones that are optimized into others), each containing a list of tuples, (fieldName, matchingValue)

 
Data
        FILTER_PARAM_RE = re.compile('^(?P<field>.+)__(?P<filterType>.+)$')
__all__ = ('FILTER_PARAM_RE', 'getFiltersFromArgs', 'QueryableListBase')