Bases: object
Adds schedule info to the mixed in class.
Adds schedule information like start_date, due_date and duration. There are theree parameters to initialize a class with ScheduleMixin, which are, start_date, due_date and duration. Only two of them are enough to initialize the class. The preceeding order for the parameters is as follows:
start_date > due_date > duration
So if all of the parameters are given only the start_date and the due_date will be used and the duration will be calculated accordingly. In any other conditions the missing parameter will be calculated from the following table:
start_date | due_date | duration | DEFAULTS |
---|---|---|---|
start_date = datetime.date.today() duration = datetime.timedelta(days=10) due_date = start_date + duration |
|||
X | duration = datetime.timedelta(days=10) due_date = start_date + duration |
||
X | X | duration = due_date - start_date | |
X | X | due_date = start_date + duration | |
X | X | X | duration = due_date - start_date |
X | X | start_date = due_date - duration | |
X | duration = datetime.timedelta(days=10) start_date = due_date - duration |
||
X | start_date = datetime.date.today() due_date = start_date + duration |
The date attributes can be managed with timezones. Follow the Python idioms shown in the documentation of datetime
Parameters: |
|
---|
Methods
__init__(**kwargs[, start_date, due_date, ...]) |