register upgrades on interface (or base class)

Bug #100931 reported by Clemens Robbenhaar
10
Affects Status Importance Assigned to Milestone
Silva
Confirmed
Wishlist
Sylvain Viollon

Bug Description

It would be nice if one could also register upgrade finctions
ont only by meta type, but also for all contents
implementing a certain interfaces, or having a certain base class.

 For example for the upgrade to 0.9.3
to get rid of all broken DemoObjects (issue653)
one needs to check all IContainer, if they cointain
any cadavers of these objects.

 To reset the versioned content public rendering cache
(issue717)
on needs to cal a certain method on all objects,
which derive from VersionedContent

 A workaround is to register an upgrader
for all object and then check the object manually
for the wanted interface / base class

Changed in silva:
assignee: nobody → aaltepet
Revision history for this message
Andy Altepeter (aaltepet) wrote :

would you like me to work on this? I think registering on interfaces would be best.
This would require some changes to upgrade.py:

1) a new functions for registering for interfaces:
  registerForInterface
  registerFunctionForInterface
  registerUpgraderForInterface
2) a new __interface_registry
3) getUpgraders will also need to loop through the interface_registry for the version to see if the current object implements each interface. So, this may or may not slow down the upgrade process. Or, it may be possible to go the other way, and get all interfaces implemented by the current object, then seeing if each/any are in the registry...these lookups could be cached during the upgrade to speedup the process, but that would ignore potential marker interfaces set on a particular object.

Changed in silva:
assignee: aaltepet → kitblake
Kit Blake (kitblake)
Changed in silva:
assignee: Kit Blake (kitblake) → Sylvain Viollon (thefunny)
Revision history for this message
Sylvain Viollon (thefunny) wrote :

This is something to do, but will require to update old upgraders as well.

Changed in silva:
milestone: none → 3.1.0
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.