There are several possible ways to derive your model. All look the same to a Controller.
Bases: gtkmvc.observer.Observer
Class attribute. A list or tuple of name strings. The metaclass ObservablePropertyMeta uses it to create properties.
Value properties have to exist as an attribute with an initial value, which may be None.
Logical properties require a getter and may have a setter method in the class.
All observable properties accessible from this instance.
| Return type: | frozenset of strings |
|---|
Decorate a method as a logical property getter. Comes in two flavours:
Send a notification to all registered observers.
args the arguments we just passed to meth_name.
res the return value of the method call.
Send a notification to all registered observers.
instance the object stored in the property.
meth_name name of the method we are about to call on instance.
Send a notification to all registered observers.
old the value before the change occured.
Emit a signal to all registered observers.
prop_name the property storing the Signal instance.
arg one arbitrary argument passed to observing methods.
Decorate a method as a logical property setter. The counterpart to getter(). Also comes in two flavours:
Bases: sqlobject.inheritance.InheritableSQLObject, gtkmvc.model.Model
SQLObject uses a class’s name for the corresponding table, so subclasses of this need application-wide unique names, no matter what package they’re in!
After defining subclasses (not before!) you have to call .createTable on each, including SQLObjectModel itself.
Recursively calls InheritableSQLObject.createTable on this and all subclasses, passing any arguments on.
Call this during startup, after setting up the DB connection and importing all your persistent models. Pass ifNotExists=True unless you want to wipe the database.
Bases: gtkmvc.model.Model, gtk.TextBuffer
Use this class as base class for your model derived by gtk.TextBuffer
Bases: gtkmvc.model.Model, gtk.ListStore
Use this class as base class for your model derived by gtk.ListStore
Bases: gtkmvc.model.Model, gtk.TreeStore
Use this class as base class for your model derived by gtk.TreeStore