kiwi.accessor
module documentationkiwi
The accessor module offers two important front-end functions: kgetattr and ksetattr. These functions allow retrieving attribute values from objects much in the same way as getattr/setattr allow, but with two important differences:
Function | get_default_getter | No summary |
Function | get_default_setter | No summary |
Class | CacheControl | Undocumented |
Class | DefaultValue | This can be raised in kgetattr accessors to indicate that the default value should be used |
Function | kgetattr_guard | Undocumented |
Function | ksetattr_guard | Undocumented |
Function | kgetattr | No summary |
Function | ksetattr | Set the value associated with the attribute in model named by attr_name. If flat=1 is specified, no dot path parsing will be done. |
Function | enable_attr_cache | No summary |
Function | clear_attr_cache | Clears the kgetattr cache. It must be called repeatedly to avoid memory leaks in Python 2.0 and earlier. |
Class | _AttrUnset | Undocumented |
Obtains from model a callable through which attr_name can be retrieved. This callable is an accessor named get_foo, where foo is the value of attr_name, or getattr(model, foo) if the accessor does not exist. If the callable exists, it is returned; if getattr() is to be used a tuple in the format (model, attr_name) is returned.
Obtains from model a callable through which attr_name can be set. This callable is an accessor named set_foo, where foo is the value of attr_name, or setattr(model, foo, value) if the accessor does not exist. If the callable exists, it is returned; if setattr() is to be used a tuple in the format (model, attr_name) is returned.
Returns the value associated with the attribute in model named by attr_name. If default is provided and model does not have an attribute called attr_name, the default value is returned. If flat=1 is specified, no dot path parsing will be done.
Set the value associated with the attribute in model named by attr_name. If flat=1 is specified, no dot path parsing will be done.