Update: Removed TimeLog._expand_task_schedule_timing() method which was automatically adjusting the schedule_timing and schedule_unit of a Task to total duration of the TimeLogs of that particular task, thus increasing the schedule info with the entered time logs.
But it was setting the schedule_timing to 0 in some certain cases and it was unnecessary because the main purpose of this method was to prevent TaskJuggler to raise any errors related to the inconsistencies between the schedule values and the duration of TimeLogs and TaskJuggler has never given a real error about that situation.
Fix: Fixed the following columns column type from String to Text:
- Permissions.class_name
- SimpleEntities.description
- Links.full_path
- Structures.custom_template
- FilenameTemplates.path
- FilenameTemplates.filename
- Tickets.summary
- Wiki.title
- Wiki.content
and specified a size for the following columns:
- SimpleEntities.html_class -> String(32)
- SimpleEntities.html_style -> String(32)
- FilenameTemplates.target_entity_type -> String(32)
to be compatible with MySQL.
Update: It is now possible to create TimeLog instances for a Task with PREV status.
Update: The following column names are updated:
Also updated alembic migration to create columns with those names.
Update: Updated Alembic revision 433d9caaafab (the one related with stalker 2.5 update) to also include following updates:
Update: Revision class is renamed to Review and introduced a couple of new attributes.
New: Added a new workflow called “Task Review Workflow”. Please see the documentation about the new workflow.
Update: Task.responsible attribute is now a list which allows multiple responsible to be set for a Task.
New: Because of the new “Task Review Workflow” task statuses which are normally created in Stalker Pyramid are now automatically created in Stalker database initialization. The new statuses are Waiting For Dependency (WFD), Ready To Start (RTS), Work In Progress (WIP), Pending Review (PREV), Has Revision (HREV), On Hold (OH), Stopped (STOP) and Completed (CMPL) are all used in Task, Asset, Shot and Sequence status lists by default.
New: Because of the new “Task Review Workflow” also a status list for Review class is created by default. It contains the statuses of New (NEW), Requested Revision (RREV) and Approved (APP).
Fix: Users.login column is now unique.
Update: Ticket workflow in config is now using the proper status names instead of the lower case names of the statuses.
New: Added a new exception called StatusError which states the entity status is not suitable for the action it is applied to.
New: Studio instance now stores the scheduling state to the database to prevent two scheduling process to override each other. It also stores the last schedule message and the last schedule date and the id of the user who has done the scheduling.
New: The Task Dependency relation is now using an Association Object instead of just a Secondary Table. The Task.depends and Task.dependent_of attributes are now association_proxies.
Also added extra parameters like dependency_target, gap_timing, gap_unit and gap_model to the dependency relation. So all of the dependency relations are now able to hold those extra information.
Updated the task_tjp_template to reflect the details of the dependencies that a task has.
New: ScheduleMixin class now has some default class attributes that will allow customizations in inherited classes. This is mainly done for TaskDependency class and for the gap_timing, gap_unit, gap_model attributes which are in fact synonyms of schedule_timing, schedule_unit and schedule_model attributes coming from the ScheduleMixin class. So by using the __default_schedule_attr_name__ Stalker is able to display error messages complaining about gap_timing attribute instead of schedule_timing etc.
New: Updating a task by calling Task.request_revision() will now set the TaskDependency.dependency_target to ‘onstart’ for tasks those are depending to the revised task and updated to have a status of DREV, OH or STOP. Thus, TaskJuggler will be able to continue scheduling these tasks even if the tasks are now working together.
Update: Updated the TaskJuggler templates to make the tjp output a little bit more readable.
New: ScheduleMixin now creates more localized (to the mixed in class) column and enum type names in the mixed in classes.
For example, it creates the TaskScheduleModel enum type for Task class and for TaskDependency it creates TaskDependencyGapModel with the same setup following the {{class_name}}{{attr_name}}Model template.
Also it creates schedule_model column for Task, and gap_model for TaskDependency class.
Update: Renamed the TaskScheduleUnit enum type name to TimeUnit in ScheduleMixin.
New: Added new class called Revision to hold info about Task revisions.
Update: Renamed ScheduleMixin to DateRangeMixin.
New: Added a new mixin called ScheduleMixin (replacing the old one) which adds attributes like schedule_timing, schedule_unit, schedule_model and schedule_constraint.
New: Added Task.tickets and Task.open_tickets properties.
Update: Removed unnecessary arguments (project_lead, tasks, watching, last_login) from User class.
Update: The timing_resolution attribute is moved from the DateRangeMixin to Studio class. So instances of classes like Project or Task will not have their own timing resolution anymore.
New: The Studio instance now overrides the values on stalker.defaults on creation and on load, and also the db.setup() function lets the first Studio instance that it finds to update the defaults. So it is now possible to use stalker.defaults all the time without worrying about the Studio settings.
Update: The Studio.yearly_working_days value is now always an integer.
New: Added a new method ScheduleMixin.least_meaningful_time_unit() to calculate the most appropriate timing unit and the value of the given seconds which represents an interval of time.
So it will convert 3600 seconds to 1 hours, and 8424000 seconds to 1 years if it represents working time (as_working_time=True) or 2340 hours if it is representing the calendar time.
New: Added a new method to ScheduleMixin called to_seconds(). The to_seconds() method converts the given schedule info values (schedule_timing, schedule_unit, schedule_model) to seconds considering if the given schedule_model is work time based (‘effort’ or ‘length’) or calendar time based (‘duration’).
New: Added a new method to ScheduleMixin called schedule_seconds which you may recognise from Task class. What it does is pretty much the same as in the Task class, it converts the given schedule info values to seconds.
Update: In DateRangeMixin, when the start, end or duration arguments given so that the duration is smaller then the defaults.timing_resolution the defaults.timing_resolution will be used as the duration and the end will be recalculated by anchoring the start value.
New: Adding a TimeLog to a Task and extending its schedule info values now will always use the least meaningful timing unit. So expanding a task from 16 hours to 18 hours will result a task with 2 days of schedule (considering the daily_working_hours = 9).
Update: Moved the daily_working_hours attribute from Studio class to WorkingHours class as it was much related to this one then Studio class. Left a property with the same name in the Studio class, so it will still function as it was before but there will be no column in the database for that attribute anymore.
New: Added a new attribute to Version class called latest_version which holds the latest version in the version queue.
New: To optimize the database connection times, stalker.db.setup() will not try to initialize the database every time it is called anymore. This leads a ~4x speed up in database connection setup. To initialize a newly created database please use:
# for a newly created database
from stalker import db
db.setup() # connects to database
db.init() # fills some default values to be used with Stalker
# for any subsequent access just use (don't need to call db.init())
db.setup()
Update: Removed all __init_on_load() methods from all of the classes. It was causing SQLAlchemy to eagerly load relations, thus slowing down queries in certain cases (especially in Task.parent -> Task.children relation).
Fix: Fixed Vacation class tj3 format.
Fix: Studio.now attribute was not properly working when the Studio instance has been restored from database.
Added new attribute to WorkingHours class called weekly_working_hours, which calculates the weekly working hours based on the working hours defined in the instance.
Task class now has a new attribute called schedule_timing which is replacing the effort, length and duration attributes. Together with the schedule_model attribute it will be used in scheduling the Task.
Updated the config system to the one used in oyProjectManager (based on Sphinx config system). Now to reach the defaults:
# instead of doing the following
from stalker.conf import defaults # not valid anymore
# use this
from stalker import defaults
If the above idiom is used, the old defaults module behaviour is retained, so no code change is required other than the new lower case config variable names.
Changed these default setting value names to corresponding new names:
stalker.conf.defaults:
stalker.models.project.Project:
Removed Project.project_tasks attribute, use Project.tasks directly to get all the Tasks in that project. For root task you can do a quick query:
Task.query.filter(Task.project==proj_id).filter(Task.parent==None).all()
This will also return the Assets, Sequences and Shots in that project, which are also Tasks.
Users are now assigned to Projects by appending them to the Project.users list. This is done in this way to allow a reduced list of resources to be shown in the Task creation dialogs.
Added a new helper class for Project working hour management, called WorkingHours.
Added a new attribute to Project class called working_hours which holds stalker.models.project.WorkingHours instances to manage the Project working hours. It will directly be passed to TaskJuggler.
stalker.models.task.Task:
ScheduleMixin:
Removed the TaskableEntity.
Asset, Sequence and Shot classes are now derived from Task class allowing more complex Task relation combined with the new parent/child relation of Tasks. Use Asset.children or Asset.tasks to reach the child tasks of that asset (same with Sequence and Shot classes).
stalker.models.shot.Shot:
In tests all the Warnings are now properly handled as Warnings.
stalker.models.ticket.Ticket:
Added a new class called Scene to manage Shots with another property.
Removed the output_path attribute in FilenameTemplate class.
Grouped the templates for each entity under a directory with the entity name.
The code attribute of the SimpleEntity is now introduced as a separate mixin. To let it be used by the classes it is really needed.
The query method is now converted to a property so it is now possible to use it like a property as in the SQLAlchemy.orm.Session as shown below:
from stalker import Project
Project.query.all() # instead of Project.query().all()
ScheduleMixin.due_date is renamed to ScheduleMixin.end_date.
Added a new class attribute to SimpleEntity called __auto_name__ which controls the naming of the instances and instances derived from SimpleEntity. If __auto_name__ is set to True the name attribute of the instance will be automatically generated and it will have the following format:
{{ClassName}}_{{UUID4}}
Here are a couple of naming examples:
Ticket_74bb46b0-29de-4f3e-b4e6-8bcf6aed352d
Version_2fa5749e-8cdb-4887-aef2-6d8cec6a4faa
Fixed an autoflush issue with SQLAlchemy in StatusList class. Now the status column is again not nullable in StatusMixin.
Added a new class called EntityType to hold all the available class names and capabilities.
Version class now has a new attribute called inputs to hold the inputs of the current Version instance. It is a list of Link instances.
FilenameTemplate classes path and filename attributes are no more converted to string, so given a non string value will raise TypeError.
Structure.custom_template now only accepts strings and None, setting it to anything else will raise a TypeError.
Two Type’s for FilenameTemplate’s are created by default when initializing the database, first is called “Version” and it is used to define FilenameTemplates which are used for placing Version source files. The second one is called “Reference” and it is used when injecting references to a given class. Along with the FilenameTemplate.target_entity_type this will allow one to create two different FilenameTemplates for one class:
# first get the Types
vers_type = Type.query()\
.filter_by(target_entity_type="FilenameTemplate")\
.filter_by(type="Version")\
.first()
ref_type = Type.query()\
.filter_by(target_entity_type="FilenameTemplate")\
.filter_by(type="Reference")\
.first()
# lets create a FilenameTemplate for placing Asset Version files.
f_ver = FilenameTemplate(
target_entity_type="Asset",
type=vers_type,
path="Assets/{{asset.type.code}}/{{asset.code}}/{{task.type.code}}",
filename="{{asset.code}}_{{version.take_name}}_{{task.type.code}}_v{{'%03d'|version.version_number}}{{link.extension}}"
output_path="{{version.path}}/Outputs/{{version.take_name}}"
)
# and now define a FilenameTemplate for placing Asset Reference files.
# no need to have an output_path here...
f_ref = FilenameTemplate(
target_entity_type="Asset",
type=ref_type,
path="Assets/{{asset.type.code}}/{{asset.code}}/References",
filename="{{link.type.code}}/{{link.id}}{{link.extension}}"
)
stalker.db.register() now accepts only real classes instead of class names. This way it can store more information about classes.
Status.bg_color and Status.fg_color attributes are now simple integers. And the Color class is removed.
StatusMixin.status is now a ForeignKey to a the Statuses table, thus it is a real Status instance instead of an integer showing the index of the Status in the related StatusList. This way the Status of the object will not change if the content of the StatusList is changed.
Added new attribute Project.project_tasks which holds all the direct or indirect Tasks created for that project.
User.login_name is renamed to User.login.
Removed the first_name, last_name and initials attributes from User class. Now the name and code attributes are going to be used, thus the name attribute is no more the equivalent of login and the code attribute is doing what was initials doing previously.
SimpleEntity now has an attribute called generic_data which can hold any kind of SOM object inside and it is a list.
Changed the formatting rules for the name in SimpleEntity class, now it can start with a number, and it is not allowed to have multiple whitespace characters following each other.
The source attribute in Version is renamed to source_file.
The version attribute in Version is renamed to version_number.
The take attribute in Version is renamed to take_name.
The version_number in Version is now generated automatically if it is skipped or given as None or it is too low where there is already a version number for the same Version series (means attached to the same Task and has the same take_name.
Moved the User class to stalker.models.auth module.
Removed the stalker.ext.auth module because it is not necessary anymore. Thus the User now handles all the password conversions by itself.
PermissionGroup is renamed back to Group again to match with the general naming of the authorization concept.
Created two new classes for the Authorization system, first one is called Permission and the second one is a Mixin which is called ACLMixin which adds ACLs to the mixed in class. For now, only the User and Group classes are mixed with this mixin by default.
The declarative Base class of SQLAlchemy is now created by binding it to a ORMClass (a random name) which lets all the derived class to have a method called query which will bypass the need of calling DBSession.query(class_) but instead just call class_.query():
from stalker.models.auth import User
user_1 = User.query().filter_by(name='a user name').first()
Changed the db.setup arguments. It is now accepting a dictionary instead of just a string to comply with the SQLAlchemy scaffold and this dictionary should contain keys for the SQLAlchemy engine setup. There is another utility that comes with Pyramid to setup the database under the scripts folder, it is also working without any problem with stalker.db.
The session variable is renamed to DBSession and is now a scopped session, so there is no need to use DBSession.commit it will be handled by the system it self.
Even though the DBSession is using the Zope Transaction Manager extension normally, in the database tests no extension is used because the transaction manager was swallowing all errors and it was a little weird to try to catch this errors out of the with block.
Refactored the code, all the models are now in separate python files, but can be directly imported from the main stalker module as shown:
from stalker import User, Department, Task
By using this kind of organization, both development and usage will be eased out.
task_of now only accepts TaskableEntity instances.
Updated the examples. It is now showing how to extend SOM correctly.
Updated the references to the SOM classes in docstrings and rst files.
Removed the Review class. And introduced the much handier Ticket class. Now reviewing a data is the process of creating Ticket’s to that data.
The database is now initialized with a StatusList and a couple of Statuses appropriate for Ticket instances.
The database is now initialized with two Type instances (‘Enhancement’ and ‘Defect’) suitable for Ticket instances.
StatusMixin now stores the status attribute as an Integer showing the index of the Status in the status_list attribute but when asked for the value of StatusMixin.status attribute it will return a proper Status instance and the attribute can be set with an integer or with a proper Status instance.