register upgrades on interface (or base class)
Bug #100931 reported by
Clemens Robbenhaar
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 |
Changed in silva: | |
assignee: | Kit Blake (kitblake) → Sylvain Viollon (thefunny) |
To post a comment you must log in.
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: terface ionForInterface derForInterface registry
registerForIn
registerFunct
registerUpgra
2) a new __interface_
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.