[ZODB-Dev] grab zodb dict keys by search term

Tamer Higazi tameritoke2 at arcor.de
Wed Dec 25 07:43:31 CET 2013


And that is exactly what I was looking for!

Thanks!


Tamer

On 11.12.2013 14:27, Vincent Pelletier wrote:
> On Wed, 11 Dec 2013 12:27:19 +0200,
> Tamer Higazi <tameritoke2 at arcor.de> wrote :
>> If i would have 100.000 - 500.000 entries, where 150 would match, I
>> don't want to go over those completely.
>>
>> So, if there is a pythonic way to get it solved on a performant way, or
>> a ZODB way as well that would be wondefull.
> BTrees have a very nice API, which allow scanning only a subset of keys
> by providing min and max boundaries:
>    for key, value in some_btree.items(
>            min='aa', max='b', excludemax=True):
>        # Do stuff
> should do what you want.
>
> http://pythonhosted.org/BTrees/



More information about the ZODB-Dev mailing list