stalker.models.version.Version¶
-
class
stalker.models.version.
Version
(task=None, take_name=’Main’, inputs=None, outputs=None, parent=None, full_path=None, created_with=None, **kwargs)[source]¶ Bases:
stalker.models.link.Link
,stalker.models.mixins.DAGMixin
Holds information about the created versions (files) for a class:.Task
A
Version
holds information about the created files related to a class:.Task. So if one creates a new version for a file or a sequences of file for aTask
then the information is hold in theVersion
instance.Parameters: - take_name (str) – A short string holding the current take name. Takes
in Stalker are used solely for grouping individual versions together.
Versions with the same
take_name
(of the same Task) are numbered together. It can be any alphanumeric value (a-zA-Z0-9_). The default is the string “Main”. When skipped it will use the default value. It can not start with a number. It can not have white spaces. - inputs (list of
Link
) – A list oLink
instances, holding the inputs of the current version. It could be a texture for a Maya file or an image sequence for Nuke, or anything those you can think as the input for the current Version. - outputs (list of
Link
instances) – A list ofLink
instances, holding the outputs of the current version. It could be the rendered image sequences out of Maya or Nuke, or it can be a Targa file which is the output of a Photoshop file (*.psd), or anything that you can think as the output which is created out of this Version. - task (
Task
) – ATask
instance showing the owner of this Version. - parent (
Version
) – AVersion
instance which is the parent of this Version. It is mainly used to see which Version is derived from which in the Version history of aTask
.
-
__init__
(task=None, take_name=’Main’, inputs=None, outputs=None, parent=None, full_path=None, created_with=None, **kwargs)¶
Methods
__init__
([task, take_name, inputs, outputs, …])is_latest_published_version
()returns True if this is the latest published Version False otherwise update_paths
()updates the path variables walk_hierarchy
([method])Walks the hierarchy of this task. walk_inputs
([method])Walks the inputs of this version Attributes
absolute_full_path
Returns the absolute full path of this version including the absolute_path
Returns the absolute path. children
Other Budget
instances which are the children of this one.created_by
The User
who has created this object.created_by_id
The id of the User
who has created this entity.created_with
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. entity_groups
entity_id
entity_type
extension
the extension property filename
the filename property full_path
The full path of the url to the link. generic_data
This attribute can hold any kind of data which exists in SOM. generic_text
This attribute can hold any text. html_class
html_style
id
inputs
The inputs of the current version. is_container
Returns True if the Task has children Tasks is_leaf
Returns True if the Task has no children Tasks is_published
is_root
Returns True if the Task has no parent latest_published_version
Returns the last published version. latest_version
returns the Version instance with the highest version number in this link_id
max_version_number
returns the maximum version number for this Version metadata
name
Name of this object naming_parents
returns a list of parents which start from the nearest Asset, Shot nice_name
the overridden nice name for Version class notes
All the Notes
s attached to this entity.original_filename
outputs
The outputs of the current version. parent
A Version
instance which is the parent of this Version.parent_id
parents
Returns all of the parents of this mixed in class starting from the path
the path property plural_class_name
the plural name of this class query
tags
A list of tags attached to this object. take_name
Takes in Versions are used solely for grouping individual versions together. task
The Task
instance that this Version is created for.task_id
thumbnail
thumbnail_id
tjp_id
returns TaskJuggler compatible id to_tjp
renders a TaskJuggler compliant string used for TaskJuggler 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 this entity.version_id
version_number
The version_number
attribute is read-only.-
take_name
¶ Takes in Versions are used solely for grouping individual versions together.
-
version_number
¶ The
version_number
attribute is read-only. Trying to change it will produce an AttributeError.
-
latest_version
¶ returns the Version instance with the highest version number in this series.
Returns: Version
instance
-
max_version_number
¶ returns the maximum version number for this Version :return: int
-
absolute_full_path
¶ Returns the absolute full path of this version including the repository path of the related project
Returns: str
-
absolute_path
¶ Returns the absolute path.
Due to the changes in the project.repository
Returns: str
-
is_latest_published_version
()[source]¶ returns True if this is the latest published Version False otherwise
-
children
¶ Other
Budget
instances which are the children of this one. This attribute along with theparent
attribute is used in creating a DAG hierarchy of tasks.
-
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.
-
extension
¶ the extension property
-
filename
¶ the filename property
-
full_path
¶ The full path of the url to the link.
-
generic_data
¶ This attribute can hold any kind of data which exists in SOM.
-
generic_text
¶ This attribute can hold any text.
-
is_container
¶ Returns True if the Task has children Tasks
-
is_leaf
¶ Returns True if the Task has no children Tasks
-
is_root
¶ Returns True if the Task has no parent
-
name
¶ Name of this object
-
notes
¶ All the
Notes
s attached to this entity.It is a list of
Note
instances or an empty list, setting it to None will raise a TypeError.
-
parent
¶ A
Version
instance which is the parent of this Version. In Stalker it is possible to create a hierarchy of Version.
-
parents
¶ Returns all of the parents of this mixed in class starting from the root
-
path
¶ the path property
-
plural_class_name
¶ the plural name of this class
A list of tags attached to this object.
It is a list of
Tag
instances which shows the tags of this object
-
tjp_id
¶ returns TaskJuggler compatible id
-
to_tjp
¶ renders a TaskJuggler compliant string used for TaskJuggler integration. Needs to be overridden in inherited classes.
-
type
¶ The type of the object.
It is a
Type
instance with a properType.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.
-
walk_hierarchy
(method=0)¶ Walks the hierarchy of this task.
Parameters: method – The walk method, 0: Depth First, 1: Breadth First
-
naming_parents
¶ returns a list of parents which start from the nearest Asset, Shot or Sequence
-
nice_name
¶ the overridden nice name for Version class
- take_name (str) – A short string holding the current take name. Takes
in Stalker are used solely for grouping individual versions together.
Versions with the same