stalker.models.mixins.StatusMixin¶
-
class
stalker.models.mixins.
StatusMixin
(status=None, status_list=None, **kwargs)[source]¶ Bases:
object
Makes 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
StatusList
instance in the database whomStatusList.target_entity_type
attribute is set to the current mixed-in class name. - status –
It is a
Status
instance which shows the current status of the statusable object. Integer values are also accepted, which shows the index of the desired status in thestatus_list
attribute of the current statusable object. If aStatus
instance is supplied, it should also be present in thestatus_list
attribute. If set to None then the firstStatus
instance in thestatus_list
will be used.
Methods
__init__
([status, status_list])Attributes
status
status_id
status_list
status_list_id
- status_list –