Tilt

Members
  • Content Count

    47
  • Joined

  • Last visited

  • Days Won

    3

Tilt last won the day on March 14 2017

Tilt had the most liked content!

About Tilt

  • Rank
    Advanced Member

Recent Profile Visitors

720 profile views
  1. Sorry to hijack this thread, but we're currently experiencing the same exception (IntegrityError(A note message must have recipients)). However, I'm not creating a note entity myself, I'm using .create_note on an AssetVersion or a Shot entity. Unfortunately, it pops up only now and then in an action handler so it's hard to debug. When I restart the event hub it works perfectly, when I call the event handler as a stand-alone python script after that error has happened everything works fine. So the only thing I was able to do until now was print lots of debugging output. Before the note gets created, the session isn't new but it doesn't have any pending operations (session.created/modified/deleted are empty according to my logs). The note gets created on an AssetVersion using create_note(). I supply an author and a category. Next, I set metadata on the newly created note and I modify its date (my code transfers notes from a client's Shotgun to our ftrack.) The session's operations are now: created: [<dynamic ftrack Note object 49129808>, <dynamic ftrack Metadata object 49129104>], modified: [<dynamic ftrack AssetVersion object 37916368>], deleted: [] Then the commit happens which sometimes throws that IntegrityError. In the exception handler I've done some digging around to figure out if that note object differs from other newly created notes where the exception doesn't occur. The only thing I've noticed is that parent_id and parent_type of that new note are "NOT SET" even though the new note object is part of the asset versions's ["notes"] list. Could that be the reason? The weird thing is that like I said it's hard to debug. Restarting the script so it gets a new session and re-running the whole thing has always fixed things so far.
  2. I'll give it a try! Thank you.
  3. Sorry to resurrect this old thread... getDefaultRecipients was a really nice thing in the legacy API. We're searching for a workaround for this use case: A note should get created on an asset version but not only the default recipients should get it. For example, we might want notes to a lighting task asset version also be sent to the artist assigned to the comp task. Previously, I used the result from getDefaultRecipients (which included all managers) and added the user that was assigned to comp. Now that is no longer possible, because create_note() will override the default recipients if I manually add some. Managers are also not implemented in the new API yet (and I remember reading that it's not on the todo list) so I can't just add the managers in the create_note() call myself. Are there any workarounds? Is it possible to somehow "trick" ftrack into considering a certain user as part of the default recipients? Maybe using links? cheers Stefan
  4. Hi, I'm experiencing strange errors in our event handlers and actions. They are hard to replicate and sometimes restarting the event hub and the handlers works, but sometimes it doesn't. I tried to get the thumbnail URL as described in the API docs (currently running 1.4.0) http://ftrack-python-api.rtd.ftrack.com/en/stable/example/thumbnail.html#example-thumbnail-url When calling get_thumbnail_url, I get this error: AttributeError: 'Location' object has no attribute 'get_thumbnail_url' Printing the location object in fact prints this: <Location(3a372bde-05bc-11e4-8908-20c9d081909b)> That's ftrack_api.symbol.SERVER_LOCATION_ID, but the type is just "Location". When I try the session.get("Location",...) line on another machine, this returns <ServerLocation...> and I can call get_thumbnail_url without problems. I then tried to replace the session.get(...) with session.query("Location where id=...") and get_thumbnail_url with just get_url(). Now this exception is raised in ftrack's api: File "/path/to/site-packages/ftrack_api/entity/location.py", line 607, in get_url return self.accessor.get_url(resource_identifier) AttributeError: 'Symbol' object has no attribute 'get_url' The "Symbol object has not attribute xyz" has occured before when calling get_filesystem_path on an ftrack.unmanaged location: File "/path/to/site-packages/ftrack_api/entity/location.py", line 583, in get_filesystem_path return self.get_filesystem_paths([component])[0] File "/path/to/site-packages/ftrack_api/entity/location.py", line 592, in get_filesystem_paths self.accessor.get_filesystem_path(resource_identifier) AttributeError: 'Symbol' object has no attribute 'get_filesystem_path' What could be causing this?
  5. sorry, late reply. Thanks, it works as expected by default :-)
  6. I'm migrating our last bits of code from the old API to the new one. Is there a replacement for .getDefaultRecipients() when adding notes to asset versions? That function seems to be missing. Do I just look for all users assigned to the task and add them as recipients manually? cheers Stefan
  7. Tilt

    moving TimeLogs

    worked like a charm!
  8. Tilt

    moving TimeLogs

    Thank you! I'll give that a try
  9. Tilt

    moving TimeLogs

    I want to move all the timelogs from one task to another task in another project because I want to recreate a project with a dedicated project schema. If I could just change the schema using the new python API that would be great but I think that's not possible so I just created a new project and created new tasks in the browser. But now I want to move timelogs to the new tasks so I can remove the old project from ftrack. My first thought was to just get a timelog from the old task, then append it to the new task's timelogs. But since a TimeLog references a specific context_id I don't know if that's wise or even supported. I wanted to ask how to do it before I do something that might mess with the database in unintended ways: for timelog in old_task["timelogs"]: new_task["timelogs"].append(timelog)
  10. I'm having trouble understanding the use of "has" and "any" as it is described in the api docs at http://ftrack.rtd.ftrack.com/en/stable/developing/api/query_syntax.html#filtering-on-relationships The example for "has" is: select id from Note where author has (first_name is "Jane" and last_name is "Doe") and the text states that writing that query without "has" wouldn't have the desired effect of returning notes from Jane Doe. But why is that? The way I would write this query without "has" would be: select id from Note where author.first_name is "Jane" and author.last_name is "Doe" How would this query return notes by "Jane Smith" or "John Doe"? I'm having trouble following along. I now I could play around with queries on our server but I don't really know what a correct result would look like so I'm asking this on the forum instead :-)
  11. Hi, is there a way to get all the custom_attributes in a query or a session.populate() call? I can do session.query("select custom_attributes from Shot where ....") but when I check the values with "auto_populating False", they are mostly Symbol(NOT_SET), except for default values. I can't do "select custom_attributes.fstart from Shot where ..." because that throws ftrack_api.exception.ServerError: Server reported error: KeyError(u'fstart') as does session.populate(shot, "custom_attributes.fstart") The reason I'm asking is that I usually need a bunch of custom attributes so I want to speed things up and reduce queries.
  12. Tilt

    Managers

    Is there a replacement for project.createManager() in the new API?
  13. Hi, I've tried to follow the example in the api docs on how to add attachments to jobs. However, I'm receiving a weird error. My code: job = session.create('Job', { 'user': user, 'status': 'running', 'data': dumps({'description': 'test job'}) }) server_location = session.query('Location where name is "ftrack.server"').one() component = session.create_component( logfile, data={'name': 'My FileName'}, location=server_location ) session.create( 'JobComponent', {'component_id': component['id'], 'job_id': job['id']} ) I receive an error in create_component: LocationError: Failed to register components with location <Location("ftrack.server", 3a372bde-05bc-11e4-8908-20c9d081909b)> due to error: Server reported error: PermissionError(Permission denied: not allowed to 'update' 'User'. Missing the required 'Manage users' permission.) Transferred component data that may require cleanup: [(<dynamic ftrack FileComponent object 25089360>, 'bdad7a2b-9d64-413d-be37-4a9b3dcf7ad4')] I'm using an API key that doesn't have the "Manage Users" permission. I can grant them but I'm curious as to why this error happens and why creating the component needs user management permissions in the first place.