stalker.models.mixins.StatusMixin¶
-
class
stalker.models.mixins.StatusMixin(status=None, status_list=None, **kwargs)[source]¶ Bases:
objectMakes the mixed in object statusable.
This mixin adds status and status_list attributes to the mixed in class. Any object that needs a status and a corresponding status list can include this mixin.
When mixed with a class which don’t have an __init__ method, the mixin supplies one, and in this case the parameters below must be defined.
Parameters: - status_list –
this attribute holds a status list object, which shows the possible statuses that this entity could be in. This attribute can not be empty or None. Giving a StatusList object, the StatusList.target_entity_type should match the current class.
New in version 0.1.2.a4: The status_list argument now can be skipped or can be None if there is an active database connection and there is a suitable
StatusListinstance in the database whomStatusList.target_entity_typeattribute is set to the current mixed-in class name. - status –
It is a
Statusinstance which shows the current status of the statusable object. Integer values are also accepted, which shows the index of the desired status in thestatus_listattribute of the current statusable object. If aStatusinstance is supplied, it should also be present in thestatus_listattribute. If set to None then the firstStatusinstance in thestatus_listwill be used.
Methods
__init__([status, status_list])Attributes
statusstatus_idstatus_liststatus_list_id- status_list –