kiwi.model.Model
class documentationkiwi.model
(View In Hierarchy)
Known subclasses: kiwi.model.PickledModel
The Model is a mixin to be used by domain classes when attached to Proxies. It also provides autonotification of changes to the attached proxies. Note that if using setters, a specific call to notify_proxies() may be necessary; see the doc for __setattr__.
Method | __init__ | Undocumented |
Method | ensure_init | Sets up the variables so the Model's getattr hook and proxy notification work properly. |
Method | disable_autonotify | disable automatic notification to proxies based on __setattr__. All changes to the model must be followed by a call to notify_proxies() to allow the proxies to notice the change. |
Method | notify_proxies | Notify proxies that an attribute value has changed. |
Method | register_proxy_for_attribute | Attach a proxy to an attribute. The proxy will be notified of changes to that particular attribute (my means of Proxy.notify()). |
Method | unregister_proxy_for_attribute | Detach a proxy from an attribute. |
Method | unregister_proxy | Deattach a proxy completely from the model |
Method | flush_proxies | Removes all proxies attached to Model |
Method | block_proxy | Temporarily block a proxy from receiving any notification. See unblock_proxy() |
Method | unblock_proxy | Re-enable notifications to a proxy |
Method | __setattr__ | A special setattr hook that notifies the registered proxies that the model has changed. Work around it setting attributes directly to self.__dict__. |
Sets up the variables so the Model's getattr hook and proxy notification work properly.
disable automatic notification to proxies based on __setattr__. All changes to the model must be followed by a call to notify_proxies() to allow the proxies to notice the change.
Attach a proxy to an attribute. The proxy will be notified of changes to that particular attribute (my means of Proxy.notify()).
Temporarily block a proxy from receiving any notification. See unblock_proxy()
A special setattr hook that notifies the registered proxies that the model has changed. Work around it setting attributes directly to self.__dict__. Note that setattr() assumes that the name of the attribute being changed and the proxy attribute are the same. If this is not the case (as may happen when using setters) you must call notify_proxies() manually from the subclass' setter.