SearchableCollection API Documentation

In General SearchableCollection attempts to mimic the functionality of a list exactly

that means you can do indexing like my_list[0], my_list[-1]

and you can also do slicing like my_list[5:15:3]

and you can do standard list setitems like my_list[6] = SomeClass()

you can also use the normal x in my_list operator

Available Methods

classmethod SearchableCollection.find_one_where(**query_conditions)
Parameters:query_conditions (SEE: QUERY ARGUMENTS) – keyword pairs that describe the current search criteria
Returns:A single match from the collection (the first match found), or None if no match is found

search the collection and return the first item that matches our search criteria

my_collection.find_one_where(sn="123123",in_use=False)
classmethod SearchableCollection.find_all_where(**query_conditions)
Parameters:query_conditions (SEE: QUERY ARGUMENTS) – keyword pairs that describe the current search criteria
Returns:all of the matches from the collection
Return type:generator

this will search the collection for any items matching the provided criteria

for result in my_collection.find_all_where(condition1=3, condition2=4):
    do_something(result)
classmethod SearchableCollection.delete_where(**query_conditions)
Parameters:query_conditions (SEE: QUERY ARGUMENTS) – keyword pairs that describe the current search criteria
Returns:None

Deletes any items in the collection that match the given search criteria

my_collection.delete_where(sn__startswith="AB") # delete all things that have a sn attribute starting with "AB"