tik_manager4.objects.project

Project Module.

Inherits from Subproject and adds project specific methods and properties.

Classes

Project

Project class to handle project specific data and methods.

Module Contents

class Project(path=None, name=None)

Bases: tik_manager4.objects.subproject.Subproject

Project class to handle project specific data and methods.

create_sub_project(name, parent_uid=None, parent_path=None, uid=None, **properties)

Create a sub-project under a specified parent sub and write data to persistent database.

Either parent_uid or parent_path should be provided.

Args:

name (str): Name of the subproject parent_uid (int): Parent Subproject Unique ID or project itself.

Either this or parent_path needs to be defined

parent_path (str): Parent Sub-Project Relative path. If uid defined this

will be skipped

uid (int): Unique ID of the subproject. If not provided, a new one will be generated. **properties: Additional properties to be added to the subproject

Returns:

Subproject: The created subproject object if successful, -1 otherwise.

create_task(name, categories=None, parent_uid=None, parent_path=None, metadata_overrides=None)

Create a task and stores it in persistent database.

Either parent_uid or parent_path must be provided.

Args:

name (str): Name of the task. categories (list): List of categories. parent_uid (int): Parent subproject unique id. parent_path (str): Parent subproject relative path. metadata_overrides (dict): Metadata overrides for the task.

Returns:

int: 1 if successful, -1 otherwise.

delete_sub_project(uid=None, path=None)

Delete a subproject and all its children.

Either uid or path should be provided.

Args:

uid (int): The unique id of the subproject. path (str): The relative path of the subproject.

Returns:

int: 1 if successful, -1 otherwise.

edit_sub_project(uid=None, path=None, name=None, **properties)

Edit a subproject and store it in persistent database.

Either uid or path must be provided.

Args:

uid (int): Unique id of the subproject. path (str): Relative path of the subproject. name (str): New name of the subproject. **properties: Additional properties to be added to the subproject.

Returns:

int: 1 if successful, -1 otherwise.

find_work_by_absolute_path(file_path)

Using the absolute path of the scene file return work object and version number.

Args:

file_path: (String) Absolute path of the scene file.

Returns:

Tuple: (<work object>, <version number>)

get_current_work()

Get the current work object AND version by resolving the current scene.

Returns:

Tuple(<work object>, <version number>)

get_project()

Return the project object.

save_structure()

Save the project structure to the database.

Project structure is the tree of subprojects.

property absolute_path
Return the absolute path of the project.
property database_path
Return the database path of the project.
property folder
Return the root of the project, where all projects lives happily
log
object_type
property path
Return an empty string indicating the project root.