• Content Count

  • Joined

  • Last visited

  • Days Won


PeterH last won the day on December 23 2020

PeterH had the most liked content!

About PeterH

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, I've been trying to use casting with the `populate` command, but I can't find anything that works. Is it not supported or am I doing something wrong? >>> shot = session.get('Shot', shot_id) >>> session.populate(shot, 'children.status') ServerError: Server reported error: KeyError("Multiple schemas [u'Project', u'TypedContext'] found for relationship u'status'.") >>> session.populate(shot, 'children[Project].status') >>> session.populate(shot, 'children[TypedContext].status') ServerError: Server reported error: KeyError(u'children[Project]') >>> session.populate(shot, 'children.status[Project]') >>> session.populate(shot, 'children.status[TypedContext]') ServerError: Server reported error: KeyError(u"No attribute u'status[Project]' exists for schema u'Context'."
  2. I'm coming in 2 years late, but I was attempting to do this myself and found some info which might help others: If api_user == target_user, then target_user will never receive any notification. It can only be found in the sent items of author_user. The browser notification will always be from api_user. The note itself will correctly be from author_user.
  3. I'm finding that if I attempt to use a label, it stops the action form interface from loading. This appears to be a FTrack bug, as the same thing happens when trying the example form action. If I copy and paste the exact code (and change a bit to connect to the event hub), clicking on the action does absolutely nothing. If I go and remove the label entry from the form, then it loads fine.
  4. Hi, I was going to do this as a pull request but it appears you need permission for that. There's a (easily fixable) limitation with `ftrack_api.event.subscription.Subscription` in that if the object given to it is a non-string object, it will fail because it's returning the object itself inside `Subscription.__str__`. My suggestion is to call the objects `__str__` method when the class is initialised. n my particular use case, I have an object containing multiple parts of a query, and it will generate the final query after being converted to a string. It seems a bit redundant doing `event_hub.subscribe(str(obj))` when `obj` acts like a string in every way other than type. Current def __init__(self, subscription): '''Initialise with *subscription*.''' self._subscription = subscription self._expression = self.parser.parse(_subscription) # Traceback (most recent call last): # File "", line 89, in <module> # session.event_hub.subscribe(<some object>, callback) # File "ftrack_api\event\", line 436, in subscribe # self._notify_server_about_subscriber(subscriber) # File "ftrack_api\event\", line 491, in _notify_server_about_subscriber # subscription=str(subscriber.subscription) # TypeError: __str__ returned non-string (type <some object>) Proposed def __init__(self, subscription): '''Initialise with *subscription*.''' self._subscription = str(subscription) self._expression = self.parser.parse(self._subscription)
  5. Edit: This can be closed/deleted, figured it out here Hi, I'm attempting to send notes from an API user to use as a custom notification. It shows up in the sent items area of the inbox, but doesn't appear to the recipient. What am I missing here? The below method worked very well for my other tool of mass writing notes on an episode, the only difference being it's not being appended to task['notes'] this time. Create Note with content and author Create NoteLabelLink with note_id and label_id (set to "Notification" note label) Create Recipient with note_id and resource_id (the user) Commit session To provide a bit of background, I'm trying to make something where artists can subscribe to certain status changes on items (eg. animators want to know when a rig is updated). An event listener will detect that and send them a notification, I'm just a bit stuck on the notification part.
  6. I like the API but I'm not a huge fan of writing the queries as text, so I made something a while back using inspiration from SQLAlchemy. As a very quick example, if the original code is this: episode = session.query('Episode').first() task_link = session.query('select link from Task where (name not like "%task%" or name is "new") and is "{}" order by name descending'.format(episode['id'])).first() It would be constructed like this: task_link = session.Task.where( or_('%task%'), name='new'), parent=session.Episode.first(), ).select( It's able to do everything I've come across so far, if anyone is interested in using it the github page is here.
  7. PeterH

    Cancel the query

    You could perform the connection and query in a thread (or process), so if the user makes an amendment, just terminate the thread and spawn a new one.
  8. Our company has recently started making a move from ProofHQ to Review, but people have having trouble when notifying others, starting from about 2 weeks ago. As far as I'm aware this is only happening with Review and not Studio. This is from one of the producers: It appears to affect both the website notifications as well as emails, but it's very inconsistent and affects different people each time. The producers are having to write separate emails to follow up since they can't currently rely on the notifications. Is this likely something on our end or not? I've attached a couple of images to show the invites are saying they've sent, and the users notification settings are as expected.