Ignore:
Timestamp:
Sep 21, 2006 6:48:08 AM (12 years ago)
Author:
hazmat
Message:

event fixes

Location:
Products.ContentFlavors/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Products.ContentFlavors/trunk/aware.py

    r1673 r1677  
    3838    implements( IFlavorAware, IAttributeAnnotatable ) 
    3939 
     40    _v_schema = None 
     41     
    4042    def Schema( self ): 
    4143        return IFlavorSchemaProvider( self ).schema 
  • Products.ContentFlavors/trunk/configure.zcml

    r1674 r1677  
    2121 
    2222 <subscriber 
    23     handler=".schema.handleFlavorsModified" 
     23    handler=".schema.handleModifiedFlavors" 
    2424    for=".interfaces.IFlavorsModifiedEvent"/> 
    2525 
  • Products.ContentFlavors/trunk/provider.py

    r1674 r1677  
    9292                added_ifaces.add( flavor.marker ) 
    9393 
     94        # remove invalid flavors 
     95        for name in remove: 
     96            current.remove( name ) 
     97         
    9498        # gather flavor deltas for notification 
    9599        original = set( self._flavors ) - set( remove ) 
     
    117121 
    118122        # set flavors 
    119         self._flavors[:] = [f for f in flavors if f in flavor_set] 
     123        self._flavors[:] = [f for f in flavors if f in current] 
    120124 
    121125        # send notifications  
    122         notify( FlavorModifiedEvent( object, self, added, removed ) ) 
     126        notify( FlavorsModifiedEvent( self.context, self, added, removed ) ) 
    123127         
    124128    flavor_names = property( getFlavorNames, setFlavorNames ) 
  • Products.ContentFlavors/trunk/schema.py

    r1674 r1677  
    4242 
    4343    def getSchema( self ): 
    44         if not getattr(self.context, "_v_schema", None): 
     44        if self.context._v_schema is None: 
    4545            self._composeFlavorSchema() 
    4646        return ImplicitAcquisitionWrapper( self.context._v_schema, self.context ) 
     
    130130def handleModifiedFlavors( event ): 
    131131    # invalidate instance cache 
    132     if event.context._v_schema is not None: 
    133         del event.content._v_schema 
     132    if event.object._v_schema is not None: 
     133        del event.object._v_schema 
    134134    #event.context._p_changed = 1 
    135135 
Note: See TracChangeset for help on using the changeset viewer.