[Zope-dev] Threads...

Magnus Heino (Rivermen) magnus.heino@rivermen.se
Fri, 4 May 2001 16:01:12 +0200


Hi.

I want to start a thread from my product.

I'm doing it in the same way as the code below.

Label is set to 'a' as default. If I change this to 'b' and save, Label is
changed to contain 'b'.

But, it seems as if Label is loaded with the saved value at some later point
than the last row below, because Label always contains 'a' at that point.

So the question is; Where should I start the thread? When are the saved
properties loaded?


class FooBar(SimpleItem, PropertyManager):
    """ """
 
    meta_type = 'FooBar'
 
    _properties = (
        {'id':'Label', 'type':'selection', 'mode':'w',
'select_variable':'values'}
    )
 
    values = ('a', 'b', 'c')
 
    Label = values[0]
 
    manage_options = (
        {'label':'Edit', 'action':'manage_main'},
    )+PropertyManager.manage_options+\
    SimpleItem.manage_options
 
    # Create a SecurityInfo to define security
    # assertions later on
    security = ClassSecurityInfo()
 
    _v_fooThread = FooThread.FooThread(Label)
    _v_fooThread.start()

/Magnus