Bases: sqlalchemy.ext.declarative.Base
Holds versions of assets or shots.
In oyProjectManager a Version is the file created for an Asset or Shot. The placement of this file is automatically handled by the connected VersionType instance.
The values given for base_name and take_name are conditioned as follows:
- Each word in the string should start with an upper-case letter (title)
- It can have all upper-case letters
- CamelCase is allowed
- Valid characters are ([A-Z])([a-zA-Z0-9_])
- No white space characters are allowed, if a string is given with white spaces, it will be replaced with underscore (“_”) characters.
- No numbers are allowed at the beginning of the string
- No leading or trailing underscore character is allowed
So, with these rules are given, the examples for input and conditioned strings are as follows:
- “BaseName” -> “BaseName”
- “baseName” -> “BaseName”
- ” baseName” -> “BaseName”
- ” base name” -> “Base_Name”
- ” 12base name” -> “Base_Name”
- ” 12 base name” -> “Base_Name”
- ” 12 base name 13” -> “Base_Name_13”
- “>£#>$#£½$ 12 base £#$£#$£½¾{½{ name 13” -> “Base_Name_13”
- “_base_name_” -> “Base_Name”
For a newly created Version the filename and the path attributes are rendered from the associated VersionType instance. The resultant filename and path values are stored and retrieved back from the Version instance itself, no re-rendering happens. It means, the Version class depends the VersionType class only at the initialization, any change made to the VersionType instance (like changing the name or code of the VersionType) will not effect the Version instances created before this change. This is done in that way to be able to freely change the VersionType attributes and prevent loosing the connection between a Version and a file on the repository for previously created Versions.
New in version 0.2.2: Published Versions:
After v0.2.2 Versions can be set published. It is a bool attribute holding information about if this Version is published or not.
Parameters: |
|
---|
Methods
__init__(version_of, base_name, type, created_by) | |
is_latest_published_version() | returns True if this is the latest published Version False otherwise |
is_latest_version() | returns True if this is the latest Version False otherwise |
latest_published_version() | Returns the last published version. |
latest_version() | returns the Version instance with the highest version number in this |
query() | |
save() | commits the changes to the database |
update_paths() | updates the path variables |
Attributes
base_name | |
created_by | |
created_by_id | |
dependency_update_list | Calculates a list of Version |
extension | The extension of this version file, updating the extension will |
filename | The filename of this version. |
full_path | The full_path of this version. |
id | |
is_published | |
max_version | returns the maximum version number for this Version from the |
metadata | A collection of Table objects and their associated schema constructs. |
note | |
output_path | The output_path of this version. |
path | The path of this version. |
project | The Project instance that |
references | |
revision_number | |
status | The comparator class for Version.status |
take_name | |
type | The type of this Version instance. |
type_id | |
version_number | returns the version_number of this Version instance |
version_of | The instance that this version belongs to. |
version_of_id |
The instance that this version belongs to.
Generally it is a Shot or an Asset instance or anything which derives from VersionableBase class
The extension of this version file, updating the extension will also update the filename
The filename of this version.
It is automatically created by rendering the VersionType.filename template with the information supplied with this Version instance.
The path of this version.
It is automatically created by rendering the template in :class`~oyProjectManager.core.models.Version`. path of the with the information supplied by this Version instance.
The resultant path is an absolute one. But the stored path in the database is just the relative portion to the Repository. server_path
The full_path of this version.
It is the join of Repository. server_path and Version. path and Version. filename attributes.
So, it is an absolute path. The value of the full_path is not stored in the database.
The output_path of this version.
It is automatically created by rendering the VersionType. output_path template with the information supplied with this Version instance.
The resultant path is an absolute one. But the stored path in the database is just the relative portion to the Repository. server_path.
returns the Version instance with the highest version number in this series
Returns: | Version instance |
---|
returns the maximum version number for this Version from the database.
Returns: | int |
---|
returns the version_number of this Version instance
returns True if this is the latest published Version False otherwise
Calculates a list of Version instances, which are referenced by this Version and has a newer version.
Also checks the references in the referenced Version and appends the resultant list to the current dependency_update_list. Resulting a much deeper update info.
Returns: | list of Version instances. |
---|