stalker.models.project.Project¶
-
class
stalker.models.project.Project(name=None, code=None, clients=None, repositories=None, structure=None, image_format=None, fps=25.0, is_stereoscopic=False, users=None, **kwargs)[source]¶ Bases:
stalker.models.entity.Entity,stalker.models.mixins.ReferenceMixin,stalker.models.mixins.StatusMixin,stalker.models.mixins.DateRangeMixin,stalker.models.mixins.CodeMixinAll the information about a Project in Stalker is hold in this class.
Project is one of the main classes that will direct the others. A project in Stalker is a gathering point.
It is mixed with
ReferenceMixin,StatusMixin,DateRangeMixinandCodeMixinto give reference, status, schedule and code attribute. Please read the individual documentation of each of the mixins.Project Users
The
Project.usersattribute lists the users in this project. UIs like task creation for example will only list these users as available resources for this project.TaskJuggler Integration
Stalker uses TaskJuggler for scheduling the project tasks. The
Project.to_tjpattribute generates a tjp compliant string which includes the project definition, the tasks of the project, the resources in the project including the vacation definitions and all the time logs recorded for the project.For custom attributes or directives that needs to be passed to TaskJuggler you can use the
Project.custom_tjpattribute which will be attached to the generated tjp file (inside the “project” directive).To manage all the studio projects at once (schedule them at once please use
Studio).New in version 0.2.13: Multiple Repositories per Project
Starting with v0.2.13 Project instances can have multiple Repositories, which allows the project files to be placed in more than one repository according to the need of the studio pipeline. One great advantage of having multiple repositories is to be able to place Published versions in to another repository which is placed on to a faster server.
Also the
repositoriesattribute is not a read-only attribute anymore.New in version 0.2.15: Multiple Clients per Project
It is now possible to attach multiple
Clientinstances to oneProjectallowing to hold complex Projects to Client relations by using theProjectClient.roleattribute of theProjectClientclass.Parameters: - clients – The clients which the project is affiliated with. Default value is an empty list.
- image_format (
ImageFormat) – The output image format of the project. Default value is None. - fps (float) – The FPS of the project, it should be a integer or float number, or a string literal which can be correctly converted to a float. Default value is 25.0.
- type (
Type) – The type of the project. Default value is None. - structure (
Structure) – The structure of the project. Default value is None - repositories – A list of
Repositoryinstances that the project files are going to be stored in. You can not create a project without specifying the repositories argument and passing aRepositoryto it. Default value is None which raises a TypeError. - is_stereoscopic (bool) – a bool value, showing if the project is going to be a stereo 3D project, anything given as the argument will be converted to True or False. Default value is False.
- users – A list of
Users holding the users in this project. This will create a reduced or grouped list of studio workers and will make it easier to define the resources for a Task related to this project. The default value is an empty list.
-
__init__(name=None, code=None, clients=None, repositories=None, structure=None, image_format=None, fps=25.0, is_stereoscopic=False, users=None, **kwargs)¶
Methods
__init__([name, code, clients, …])round_time(dt)Round the given datetime object to the defaults.timing_resolution. Attributes
activeassetsreturns the assets related to this project budgetsclient_roleclientsA descriptor that presents a read/write view of an object attribute. codeThe code name of this object. computed_durationreturns the computed_duration as the difference of computed_start computed_endcomputed_startcomputed_total_secondsreturns the duration as seconds created_byThe Userwho has created this object.created_by_idThe id of the Userwho has created this entity.dailiesdate_createdA datetime.datetimeinstance showing the creation date and time of this object.date_updatedA datetime.datetimeinstance showing the update date and time of this object.descriptionDescription of this object. durationDuration of the entity. endThe date that the entity should be delivered. entity_groupsentity_identity_typefpsThe fps of the project. generic_dataThis attribute can hold any kind of data which exists in SOM. generic_textThis attribute can hold any text. html_classhtml_styleidimage_formatThe ImageFormatof this project.image_format_idis_activepredicate for Project.active attribute is_stereoscopicTrue if the project is a stereoscopic project metadatanameName of this object nice_nameNice name of this object. notesAll the Notess attached to this entity.open_ticketsThe list of open Tickets in this project.pagespercent_completereturns the percent_complete based on the total_logged_seconds and plural_class_namethe plural name of this class project_idqueryreferencesA list of Linkinstances given as a reference for this entity.repositoriesA descriptor that presents a read/write view of an object attribute. repositories_proxyThe Repositorythat this project files should reside.repositorycompatibility attribute for pre v0.2.13 systems. Returns the first root_tasksreturns a list of Tasks which have no parent scenesschedule_secondsreturns an integer showing the total amount of schedule timing of sequencesreturns the sequences related to this project shotsreturns the shots related to this project startThe date that this entity should start. statusThe current status of the object. status_idstatus_liststatus_list_idstructureThe structure of the project. structure_idtagsA list of tags attached to this object. tasksthumbnailthumbnail_idticketstjp_idreturns TaskJuggler compatible id to_tjpreturns a TaskJuggler compatible string representing this project total_logged_secondsreturns an integer representing the total TimeLog seconds recorded total_secondsreturns the duration as seconds typeThe type of the object. type_idThe id of the Typeof this entity.updated_byThe Userwho has updated this object.updated_by_idThe id of the Userwho has updated this entity.user_roleusersA descriptor that presents a read/write view of an object attribute. -
repositories_proxy¶ The
Repositorythat this project files should reside.Should be a list of
Repositoryinstances.
-
code¶ The code name of this object.
It accepts strings. Can not be None.
-
image_format¶ The
ImageFormatof this project.This value defines the output image format of the project, should be an instance of
ImageFormat.
-
fps¶ The fps of the project.
It is a float value, any other types will be converted to float. The default value is 25.0.
-
is_stereoscopic¶ True if the project is a stereoscopic project
-
root_tasks¶ returns a list of Tasks which have no parent
-
assets¶ returns the assets related to this project
-
sequences¶ returns the sequences related to this project
-
shots¶ returns the shots related to this project
-
to_tjp¶ returns a TaskJuggler compatible string representing this project
-
is_active¶ predicate for Project.active attribute
-
total_logged_seconds¶ returns an integer representing the total TimeLog seconds recorded in child tasks.
-
schedule_seconds¶ returns an integer showing the total amount of schedule timing of the in child tasks in seconds
-
percent_complete¶ returns the percent_complete based on the total_logged_seconds and schedule_seconds of the root tasks.
-
open_tickets¶ The list of open
Tickets in this project.returns a list of
Ticketinstances which has a status of Open and created in this project.
-
repository¶ compatibility attribute for pre v0.2.13 systems. Returns the first repository instance in the project.repositories attribute if there is any or None
-
computed_duration¶ returns the computed_duration as the difference of computed_start and computed_end if there are computed_start and computed_end otherwise returns None
-
computed_total_seconds¶ returns the duration as seconds
-
date_created¶ A
datetime.datetimeinstance showing the creation date and time of this object.
-
date_updated¶ A
datetime.datetimeinstance showing the update date and time of this object.
-
description¶ Description of this object.
-
duration¶ Duration of the entity.
It is a datetime.timedelta instance. Showing the difference of the
startand theend. If edited it changes theendattribute value.
-
end¶ The date that the entity should be delivered.
The end can be set to a datetime.timedelta and in this case it will be calculated as an offset from the start and converted to datetime.datetime again. Setting the start to a date passing the end will also set the end, so the timedelta between them is preserved, default value is 10 days
-
generic_data¶ This attribute can hold any kind of data which exists in SOM.
-
generic_text¶ This attribute can hold any text.
-
name¶ Name of this object
-
nice_name¶ 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.
-
notes¶ All the
Notess attached to this entity.It is a list of
Noteinstances or an empty list, setting it to None will raise a TypeError.
-
plural_class_name¶ the plural name of this class
-
round_time(dt)¶ Round the given datetime object to the defaults.timing_resolution.
Uses
stalker.defaults.timing_resolutionas the closest number of seconds to round to.Parameters: dt (datetime.datetime) – datetime.datetime object, defaults to now. Based on Thierry Husson’s answer in Stackoverflow
Stackoverflow : http://stackoverflow.com/a/10854034/1431079
-
start¶ The date that this entity should start.
Also effects the
DateRangeMixin.endattribute value in certain conditions, if theDateRangeMixin.startis set to a time passing theDateRangeMixin.endit will also offset theDateRangeMixin.endto keep theDateRangeMixin.durationvalue fixed.DateRangeMixin.startshould be an instance of class:datetime.datetime and the default value isdatetime.datetime.now(pytz.utc)()
-
status¶ The current status of the object.
It is a
Statusinstance which is one of the Statuses stored in thestatus_listattribute of this object.
A list of tags attached to this object.
It is a list of
Taginstances which shows the tags of this object
-
tjp_id¶ returns TaskJuggler compatible id
-
total_seconds¶ returns the duration as seconds
-
type¶ The type of the object.
It is a
Typeinstance with a properType.target_entity_type.