def add_to_cache(self, klass, widget, factory): """ Add the given widget and factory to the edit cache. The given 'klass', which acts as key for the edit cache, is automatically converted to a class, if it is an object instance. The 'factory' may be None if the edit widget is not created by the checkwidgets facility. """ klass = utils.as_class(klass) self.edit_cache[klass] = (widget, factory)
def __init__(self, klass): self.klass = utils.as_class(klass) self.keys = [] self.obj = None self.original_obj = None self.displays = {}
def init_class(self, klass, key): self.key = key self.klass = utils.as_class(klass) self.check = getattr(self.klass, key)