Bases: stalker.models.task.Task, stalker.models.mixins.CodeMixin
The Asset class is the whole idea behind Stalker.
Assets are containers of Tasks. And Tasks are the smallest meaningful part that should be accomplished to complete the Project.
An example could be given as follows; you can create an asset for one of the characters in your project. Than you can divide this character asset in to Tasks. These Tasks can be defined by the type of the Asset, which is a Type object created specifically for Asset (ie. has its target_entity_type set to “Asset”),
An Asset instance should be initialized with a Project instance (as the other classes which are mixed with the TaskMixin). And when a Project instance is given then the asset will append itself to the assets list.
No more Asset to Shot connection:
Assets now are not directly related to Shots. Instead a Version will reference the Asset and then it is easy to track which shots are referencing this Asset by querying with a join of Shot Versions referencing this Asset.
Methods
__init__(code, **kwargs) | |
round_time(dt) | Round a datetime object to any time laps in seconds. |
Attributes
asset_id | |
bid_timing | The value of the initial bid of this Task. It is an integer or |
bid_unit | The unit of the initial bid of this Task. It is a string value. |
children | |
code | The code name of this object. |
computed_duration | returns the computed_duration as the difference of computed_start |
computed_end | |
computed_start | |
computed_total_seconds | returns the duration as seconds |
created_by | The User who has created this object. |
created_by_id | The id of the User who has created |
date_created | A datetime.datetime instance showing the creation date and time of this object. |
date_updated | A datetime.datetime instance showing the update date and time of this object. |
dependent_of | |
depends | A list of Tasks that this one is depending on. |
description | Description of this object. |
duration | Duration of the entity. |
end | overridden end getter |
entity_id | |
entity_type | |
generic_data | This attribute can hold any kind of data which exists in SOM. |
id | |
is_complete | A bool value showing if this task is completed or not. |
is_container | Returns True if the Task has children Tasks |
is_leaf | Returns True if the Task has no children Tasks |
is_milestone | Specifies if this Task is a milestone. |
is_root | Returns True if the Task has no parent |
is_scheduled | A predicate which returns True if this task has both a |
level | Returns the level of this task. |
metadata | A collection of Table objects and their associated schema |
name | Name of this object |
nice_name | Nice name of this object. |
notes | All the Notess attached to this entity. |
parent | |
parent_id | |
parents | Returns all of the parents of this Task starting from the root |
plural_class_name | the plural name of this class |
priority | |
project | The owner Project of this task. |
project_id | |
query | ORM-level SQL construction object. |
references | |
remaining_seconds | returns the remaining amount of efforts, length or duration left |
resources | The list of Users assigned to this Task. |
schedule_constraint | |
schedule_model | |
schedule_seconds | returns the total effort, length or duration in seconds, for |
schedule_timing | It is the value of the schedule timing. |
schedule_unit | It is the unit of the schedule timing. |
start | overridden start getter |
status | The current status of the object. |
status_id | |
status_list | |
status_list_id | |
tags | A list of tags attached to this object. |
task_id | |
tasks | |
thumbnail | |
thumbnail_id | |
time_logs | A list of TimeLog instances showing who and when spent how much effort on this task. |
timing_resolution | The timing_resolution of this object. |
tjp_abs_id | returns the calculated absolute id of this task |
tjp_id | returns TaskJuggler compatible id |
to_tjp | TaskJuggler representation of this task |
total_logged_seconds | The total effort spent for this Task. It is the sum of all the |
total_seconds | returns the duration as seconds |
type | The type of the object. |
type_id | The id of the Type of this entity. |
updated_by | The User who has updated this object. |
updated_by_id | The id of the User who has updated |
versions | A list of Version instances showing the files created for this task. |
watchers | The list of Users watching this Task. |
The value of the initial bid of this Task. It is an integer or a float.
The unit of the initial bid of this Task. It is a string value. And should be one of ‘min’, ‘h’, ‘d’, ‘w’, ‘m’, ‘y’.
The code name of this object.
It accepts strings. Can not be None.
returns the computed_duration as the difference of computed_start and computed_end if there are computed_start and computed_end otherwise returns None
returns the duration as seconds
A datetime.datetime instance showing the creation date and time of this object.
A datetime.datetime instance showing the update date and time of this object.
A list of Tasks that this one is depending on.
A CircularDependencyError will be raised when the task dependency creates a circular dependency which means it is not allowed to create a dependency for this Task which is depending on another one which in some way depends to this one again.
Description of this object.
Duration of the entity.
It is a datetime.timedelta instance. Showing the difference of the start and the end. If edited it changes the end attribute value.
overridden end getter
This attribute can hold any kind of data which exists in SOM.
A bool value showing if this task is completed or not.
There is a good article about why not to use an attribute called percent_complete to measure how much the task is completed.
Returns True if the Task has children Tasks
Returns True if the Task has no children Tasks
Specifies if this Task is a milestone.
Milestones doesn’t need any duration, any effort and any resources. It is used to create meaningful dependencies between the critical stages of the project.
Returns True if the Task has no parent
A predicate which returns True if this task has both a computed_start and computed_end values
Returns the level of this task. It is a temporary property and will be useless when Stalker has its own implementation of a proper Gantt Chart. Write now it is used by the jQueryGantt.
Name of this object
Nice name of this object.
It has the same value with the name (contextually) but with a different format like, all the white spaces replaced by underscores (“_”), all the CamelCase form will be expanded by underscore (_) characters and it is always lower case.
All the Notess attached to this entity.
It is a list of Note instances or an empty list, setting it None will raise a TypeError.
Returns all of the parents of this Task starting from the root
the plural name of this class
The owner Project of this task.
It is a read-only attribute. It is not possible to change the owner Project of a Task it is defined when the Task is created.
returns the remaining amount of efforts, length or duration left in this Task as seconds.
Round a datetime object to any time laps in seconds.
Uses class property timing_resolution as the closest number of seconds to round to, defaults 1 hour.
Parameters: | dt – datetime.datetime object, defaults now. |
---|
Based on Thierry Husson’s answer in Stackoverflow
Stackoverflow : http://stackoverflow.com/a/10854034/1431079
returns the total effort, length or duration in seconds, for completeness calculation
It is the value of the schedule timing. It is a float value.
It is the unit of the schedule timing. It is a string value. And should be one of ‘min’, ‘h’, ‘d’, ‘w’, ‘m’, ‘y’.
overridden start getter
The current status of the object.
It is a Status instance which is one of the Statuses stored in the status_list attribute of this object.
A list of tags attached to this object.
It is a list of Tag instances which shows the tags of this object
The timing_resolution of this object.
Can be set to any value that is representable with datetime.timedelta. The default value is 1 hour. Whenever it is changed the start, end and duration values will be updated.
returns the calculated absolute id of this task
returns TaskJuggler compatible id
TaskJuggler representation of this task
The total effort spent for this Task. It is the sum of all the TimeLogs recorded for this task as seconds.
Returns int: | An integer showing the total seconds spent. |
---|
returns the duration as seconds
The type of the object.
It is an instance of Type with a proper target_entity_type.