Jana Mizikova

  • Content Count

  • Joined

  • Last visited

About Jana Mizikova

  • Rank

Recent Profile Visitors

72 profile views
  1. Thanks for the reply ! I thought those two errors are connected and caused by one thing but apparently I did two separate mistakes there : ) The query works fine now. I fixed also the part with encoding to utf-8 and works smoothly. Thank you very much ! - Jana
  2. Have you tried double symbol for new line? The web interface text fields don't create a new line after single "Enter" but after double. Try this: description = "Test \n\n test"
  3. Jana Mizikova


    Hey, I was trying to find a similar solution and I came up with a workaround. I am listing users that create calendar events in the overview for the project that in my case are the managers. Try this: def get_managers(session, project_name): events = session.query('Project where full_name is "{}"'.format(project_name)).one()['calendar_events'] managers_list = sorted(set([x['created_by']['username'] for x in events])) return managers_list
  4. Hello, recently I've been working on the custom monthly tasks report via Python API (1.7.0). And it fails everytime when tasks are created by managers with special characters in a task name, otherwise it works fine on its own. I don't want to manually rename the task in the web UI everytime it happens. I wanted to fix it in my script with exception handling block for UnicodeEncodeError. But for some reason I can't even query the task from the session to replace the wrong character in my script. I get this error: >>> session.query('Task where parent.name is "Test Subjects" and type is "R&D"').one() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "P:\.sys\python\Python27\lib\site-packages\ftrack_api\query.py", line 164, in one results, metadata = self._session._query(expression) File "P:\.sys\python\Python27\lib\site-packages\ftrack_api\session.py", line 821, in _query results = self._call(batch) File "P:\.sys\python\Python27\lib\site-packages\ftrack_api\session.py", line 1637, in _call raise ftrack_api.exception.ServerError(error_message) ftrack_api.exception.ServerError: Server reported error: AttributeError('unicode' object has no attribute '_sa_instance_state') I can query the task if conditions result in getting multiple tasks from the query, but when it gets to passing the name of the task for further processing, I get this: UnicodeEncodeError: 'ascii' codec can't encode character u'\u0161' in position 28: ordinal not in range(128) Am I doing something wrong here? I don't understand how and why it is even possible to create a task with a special character in the task name if it's using unicode as a variable type and then it cannot be queried. Is there another way how to query the task from session? Can I change encoding in the process of reading a task name? Thanks in advance for the reply! - Jane