Bases: stalker.models.task.Task, stalker.models.mixins.CodeMixin
Manages Shot related data.
Warning
Deprecated since version 0.1.2.
Because most of the shots in different projects are going to have the same name, which is a kind of a code like SH001, SH012A etc., and in Stalker you can not have two entities with the same name if their types are also matching, to guarantee all the shots are going to have different names the name attribute of the Shot instances are automatically set to a randomly generated uuid4 sequence.
Note
New in version 0.1.2.
The name of the shot can be freely set without worrying about clashing names.
Note
New in version 0.2.0.
Shot instances now can have their own image format. So you can set up different resolutions per shot.
Note
New in version 0.2.0.
Shot instances can now be created with a Project instance only, without needing a Sequence instance. Sequences are now a kind of a grouping attribute for the Shots. And Shots can have more than one Sequence.
Note
New in version 0.2.0.
Shots now have a new attribute called scenes, holding Scene instances which is another grouping attribute like sequences. Where Sequences are grouping the Shots according to their temporal position to each other, Scenes are grouping the Shots according to their view to the world, that is shots taking place in the same set configuration can be grouped together by using Scenes.
Two shots with the same code can not be assigned to the same Sequence.
The cut_out and cut_duration attributes effects each other. Setting the cut_out will change the cut_duration and setting the cut_duration will change the cut_out value. The default value of the cut_out attribute is calculated from the cut_in and cut_duration attributes. If both cut_out and cut_duration arguments are set to None, the cut_duration defaults to 100 and cut_out will be set to cut_in + cut_duration. So the priority of the attributes are as follows:
For still images (which can be also managed by shots) the cut_in and cut_out can be set to the same value so the cut_duration can be set to zero.
Because Shot is getting its relation to a Project from the passed Sequence, you can skip the project argument, and if you not the value of the project argument is not going to be used.
Parameters: |
|
---|
Methods
__init__([code, project, sequences, scenes, ...]) | |
round_time(dt) | Round a datetime object to any time laps in seconds. |
Attributes
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 |
cut_duration | The duration of this shot in frames. |
cut_in | The in frame number that this shot starts. |
cut_out | The out frame number that this shot ends. |
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 | |
image_format | The ImageFormat of this shot. |
image_format_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. |
scenes | |
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. |
sequences | |
shot_id | |
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 ImageFormat of this shot.
This value defines the output image format of this shot, should be an instance of ImageFormat.
The duration of this shot in frames.
It should be a positive integer value. If updated also updates the cut_duration attribute. The default value is 100.
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.
The id of the Type of this entity. Mainly used by SQLAlchemy to create a Many-to-One relates between SimpleEntities and Types.