Previous topic

stalker.models.mixins.ScheduleMixin

Next topic

stalker.models.mixins.TargetEntityTypeMixin

This Page

stalker.models.mixins.StatusMixin

Inheritance diagram of 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.

  • 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 the status_list attribute of the current statusable object. If a Status instance is supplied, it should also be present in the status_list attribute. If set to None then the first Status instance in the status_list will be used.

    New in version 0.2.0.

__init__(status=None, status_list=None, **kwargs)[source]

Methods

__init__([status, status_list])

Attributes

status Describes an object property that holds a single item or list of items that correspond to a related database table.
status_id Represents a column in a database table.
status_list Describes an object property that holds a single item or list of items that correspond to a related database table.
status_list_id Represents a column in a database table.