Previous topic

stalker.core.models.mixin.ReferenceMixin

Next topic

stalker.core.models.mixin.StatusMixin

This Page

stalker.core.models.mixin.ScheduleMixin

Inheritance diagram of stalker.core.models.mixin.ScheduleMixin

class stalker.core.models.mixin.ScheduleMixin(start_date=datetime.date(2011, 2, 15), due_date=datetime.timedelta(10), **kwargs)[source]

Bases: object

Adds schedule info to the mixed in class.

The schedule is the right mixin for entities which needs schedule information like start_date, due_date and duration

The date attributes can be managed with timezones. Follow the Python idioms shown in the documentation of datetime

Parameters:
  • start_date (datetime.datetime) – the start date of the entity, should be a datetime.date instance, when given as None or tried to be set to None, it is to set to today, setting the start date also effects due date, if the new start_date passes the due_date the due_date is also changed to a date to keep the timedelta between dates. The default value is datetime.date.today()
  • due_date (datetime.datetime or datetime.timedelta) – the due_date of the entity, should be a datetime.date or datetime.timedelta instance, if given as a datetime.timedelta, then it will be converted to date by adding the timedelta to the start_date attribute, when the start_date is changed to a date passing the due_date, then the due_date is also changed to a later date so the timedelta is kept between the dates. The default value is 10 days given as datetime.timedelta
__init__(start_date=datetime.date(2011, 2, 15), due_date=datetime.timedelta(10), **kwargs)[source]

Methods

__init__(2, **kwargs[, start_date, due_date])

Attributes

due_date The date that the entity should be delivered.
duration Duration of the project.
start_date The date that this entity should start.
due_date[source]

The date that the entity should be delivered.

The due_date can be set to a datetime.timedelta and in this case it will be calculated as an offset from the start_date and converted to datetime.date again. Setting the start_date to a date passing the due_date will also set the due_date so the timedelta between them is preserved, default value is 10 days

start_date[source]

The date that this entity should start.

Also effects the due_date in certain conditions, if the start_date is set to a time passing the due_date it will also offset the due_date to keep the time difference between the start_date and due_date. start_date should be an instance of datetime.date and the default value is datetime.date.today()

duration[source]

Duration of the project.

The duration is calculated by subtracting start_date from the due_date, so it is a datetime.timedelta, for now it is read-only