Bases: object
Adds schedule info to the mixed in class.
Adds attributes like schedule_timing, schedule_unit and schedule_model attributes to the mixed in class.
Use the __default_schedule_attr_name__ attribute to customize the column names.
Methods
| __init__([schedule_timing, schedule_unit, ...]) | |
| least_meaningful_time_unit(seconds[, ...]) | returns the least meaningful timing unit that corresponds to the |
| to_seconds(timing, unit, model) | converts the schedule values to seconds, depending on to the |
Attributes
| schedule_constraint | Represents a column in a database table. |
| schedule_model | Represents a column in a database table. |
| schedule_seconds | Returns the schedule values as seconds, depending on to the schedule_model the value will differ. |
| schedule_timing | Represents a column in a database table. |
| schedule_unit | Represents a column in a database table. |
returns the least meaningful timing unit that corresponds to the given seconds. So if:
- as_work_time == True
- seconds % (1 years work time as seconds) == 0 –> ‘y’ else: seconds % (1 month work time as seconds) == 0 –> ‘m’ else: seconds % (1 week work time as seconds) == 0 –> ‘w’ else: seconds % (1 day work time as seconds) == 0 –> ‘d’ else: seconds % (1 hour work time as seconds) == 0 –> ‘h’ else: seconds % (1 minutes work time as seconds) == 0 –> ‘min’ else: raise RuntimeError
- as_work_time == False
- seconds % (1 years as seconds) == 0 –> ‘y’ else: seconds % (1 month as seconds) == 0 –> ‘m’ else: seconds % (1 week as seconds) == 0 –> ‘w’ else: seconds % (1 day as seconds) == 0 –> ‘d’ else: seconds % (1 hour as seconds) == 0 –> ‘h’ else: seconds % (1 minutes as seconds) == 0 –> ‘min’ else: raise RuntimeError
| Parameters: | |
|---|---|
| Returns int, string: | |
Returns one integer and one string, showing the timing value and the unit. |
|
converts the schedule values to seconds, depending on to the schedule_model the value will differ. So if the schedule_model is ‘effort’ or ‘length’ then the schedule_time and schedule_unit values are interpreted as work time, if the schedule_model is ‘duration’ then the schedule_time and schedule_unit values are considered as calendar time.
Returns the schedule values as seconds, depending on to the schedule_model the value will differ. So if the schedule_model is ‘effort’ or ‘length’ then the schedule_time and schedule_unit values are interpreted as work time, if the schedule_model is ‘duration’ then the schedule_time and schedule_unit values are considered as calendar time.