Previous topic

stalker.models.note.Note

Next topic

stalker.models.repository.Repository

This Page

stalker.models.project.Project

Inheritance diagram of stalker.models.project.Project

class stalker.models.project.Project(name=None, code=None, lead=None, repository=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.ScheduleMixin, stalker.models.mixins.CodeMixin

All 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, ScheduleMixin and CodeMixin to give reference, status, schedule and code attribute. Please read the individual documentation of each of the mixins.

Project Users

The users attribute 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 to_tjp attribute 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 custom_tjp attribute 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).

Parameters:
  • lead (User) – The lead of the project. Default value is None.
  • 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
  • repository (Repository.) – The repository that the project files are going to be stored in. You can not create a project without specifying the repository argument and passing a Repository to 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, lead=None, repository=None, structure=None, image_format=None, fps=25.0, is_stereoscopic=False, users=None, **kwargs)[source]

Methods

__init__([name, code, lead, repository, ...])
round_time(dt) Round a datetime object to any time laps in seconds.

Attributes

active
assets returns the assets related to this project
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.
description Description of this object.
duration Duration of the entity.
end The date that the entity should be delivered.
entity_id
entity_type
fps The fps of the project.
generic_data This attribute can hold any kind of data which exists in SOM.
id
image_format The ImageFormat of this
image_format_id
is_active predicate for Project.active attribute
is_stereoscopic True if the project is a stereoscopic project
lead The lead of the project.
lead_id
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.
plural_class_name the plural name of this class
project_id_local
query ORM-level SQL construction object.
references
repository The Repository that this
repository_id
root_tasks returns a list of Tasks which have no parent
scenes
sequences returns the sequences related to this project
shots returns the shots related to this project
start The date that this entity should start.
status The current status of the object.
status_id
status_list
status_list_id
structure The structure of the project.
structure_id
tags A list of tags attached to this object.
tasks
thumbnail
thumbnail_id
tickets
timing_resolution The timing_resolution of this object.
tjp_id returns TaskJuggler compatible id
to_tjp returns a TaskJuggler compatible string representing this project
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
users
lead

The lead of the project.

Should be an instance of User, also can set to None.

repository

The Repository that this project should reside.

Should be an instance of Repository. It is a read-only attribute. So it is not possible to change the repository of one project.

structure

The structure of the project. Should be an instance of Structure class

image_format

The ImageFormat of 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

code

The code name of this object.

It accepts strings. Can not be 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

created_by

The User who has created this object.

created_by_id

The id of the User who has created this entity.

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.

description

Description of this object.

duration

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.

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.

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 Note instances or an empty list, setting it None will raise a TypeError.

plural_class_name

the plural name of this class

round_time(dt)

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

start

The date that this entity should start.

Also effects the end attribute value in certain conditions, if the start is set to a time passing the end it will also offset the end to keep the duration value fixed. start should be an instance of class:datetime.datetime and the default value is datetime.datetime.now()

status

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.

tags

A list of tags attached to this object.

It is a list of Tag instances which shows the tags of this object

timing_resolution

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.

tjp_id

returns TaskJuggler compatible id

total_seconds

returns the duration as seconds

type

The type of the object.

It is an instance of Type with a proper target_entity_type.

type_id

The id of the Type of this entity. Mainly used by SQLAlchemy to create a Many-to-One relates between SimpleEntities and Types.

updated_by

The User who has updated this object.

updated_by_id

The id of the User who has updated this entity.

root_tasks[source]

returns a list of Tasks which have no parent

assets[source]

returns the assets related to this project

sequences[source]

returns the sequences related to this project

shots[source]

returns the shots related to this project

to_tjp[source]

returns a TaskJuggler compatible string representing this project

is_active[source]

predicate for Project.active attribute