[Chandler-dev] Getting rid of all __init__ methods (for Item subclasses)

Grant Baillie grant at osafoundation.org
Thu Mar 22 13:52:58 PST 2007


On 22 Mar, 2007, at 14:09, Andi Vajda wrote:

>
> On Thu, 22 Mar 2007, Grant Baillie wrote:
>
>> I think, but am not 100% sure, the reindexingDeferred() is  
>> dangerous, since setting attributes (in general) can cause  
>> reindexing of FilterCollections that depend on those attributes.
>
> reindexingDeferred() only affects index monitors, that is, monitors  
> that maintain the sort order of sorted indexes. Filter monitors, on  
> the other hand, monitor changes affecting item membership, ie, when  
> an item changes, it could be joining or leaving or doing nothing to  
> a filter collection. Disabling reindexing only affects filter  
> monitors that run user code that accesses currently invalid sorted  
> indexes, in other words, it doesn't affect filter monitors any more  
> than anything else.

Well, I don't know the details of what filters/monitors/indexes/etc  
are coming in to play, but the attached test case raises a

LookupError: Access to skiplist is denied, it is marked INVALID

as written, and runs successfully if I remove the "with  
self.view.reindexingDeferred():" statement. Since the raise is  
triggered by a single attribute assignment (admittedly,  
EventStamp.rruleset, which results in a boatload of recurrence and  
triage status bookkeeping), I'm a little wary of adding  
view.reindexingDeferred() to the proposed __setup__.

--Grant

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_reindex.py
Type: text/x-python-script
Size: 731 bytes
Desc: not available
Url : http://lists.osafoundation.org/pipermail/chandler-dev/attachments/20070322/edcbee79/test_reindex.bin


More information about the chandler-dev mailing list