lukas g

Members
  • Content Count

    16
  • Joined

  • Last visited

About lukas g

  • Rank
    Member

Recent Profile Visitors

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

  1. lukas g

    Query Ftrack Server time

    Thank you for your quick reply. I excpected the ftrack server in UTC but I am afraid that i am seeing a 34sec time difference between utc and the creation dates of my ftrack entity. (They seem to be created in the future based on the "created_at" attribute from a Event query I am doing to check it.) Maybe I am doing something wrong but it worked out for the last months, only since yesterday I had the time difference issue. 1. I am creating and committing some new entity. 2. I am doing a query to get the event where the "parent_id" is the same as the id of the entity i just created. (Query string: "Event where parent_id is my_entity.id order by created_at dec") 3. I take the returned object and read the "created_at" attribute and compare it with the utc -> the "created_at" gives a datetime 34sec in the future. I can imagine that I am misunderstanding the way my query works and does not give me what i am expecting to get. Or that for some reason the Event Hub / Server introduces a wired time offset (maybe also caused by some faults on my side?) Thank you's for you help Lukas EDIT: I just checked it for two different ftrack projects. The one project has no time difference the other seems to have these wired 34sec offset to the future.
  2. lukas g

    Query Ftrack Server time

    Hello there i am looking for a good way to Query Ftrack Server time. Right now i am doing it in a hacky way by committing an entity and query its creation date with: "Event where parent_id is {} order by created_at desc".format(entity.id) But i am looking for some query for just the current time without creating something first, as it introduces a slight time delay and isn't a nice practice. Thank you in advance, Lukas
  3. lukas g

    Custom Attribute for User (Project Based)

    Thanks for the info. I thought it would be possible to have an attribute on a user which was only available in a project with the supplied project_id.
  4. Hello, I am trying to create an numerical custom attribute for Users but only for a specific project id. I am creating the attribute this way: session.create("CustomAttributeConfiguration", {"project_id": current_project_id, "entity_type": "user", "type": custom_attr_type, "label": "TEST", "key": "test", "default": -1, "write_security_roles": [security_role], # all roles "read_security_roles": [security_role], # all roles "config": json.dumps({'isdecimal': False})}) But I am not able to query it although I have correct permissions and I can see it in the ftrack Web Gui. users = session.get_users() for attr in users[0].["custom_attributes"]: print "Custom Attr: '{}'".format(attr) If I set project_id = None I can read and write to it. but that is not an option. Am I missing some detail on how to make it work project based? Kind regards, Lukas
  5. lukas g

    Symbol object: NOT_SET

    Hello, recently I am running into the problem that I am getting a Symbol object instead of the object i actually wanted on from my session. Mostly it happens when i am using functions from a Project object like project.project_schema. It returns NOT_SET. I tried to clear the session cache before. And I also tried to populate it manually using session.populate(project, "project_schema") but it did not help. How can I enforce a new query to my session and get a proper return value. Thank you in advance, Lukas
  6. lukas g

    How to query all priorities and set priority

    Thank you very much. that was easy I did not even think about the regular query to get them
  7. Hey, I need to query all priorities and also set the priority of entities. sth. like thsi maybe: priorities = session.get_priorities() ? entity["priority"] = priorities[0] Best Lukas
  8. lukas g

    Make Custom Attributes Mandatory?

    Hi Mattias, it would be great if you could give me more information about your "popup dialog" suggestion and how it could be realized. And maybe you can tell me if there are plans for implementing such a feature like making attributes mandatory? Best regards Lukas
  9. lukas g

    Make Custom Attributes Mandatory?

    Hi, is it possible to make a custom attribute mandatory, so the user has to give it a value on creation using the Ftrack web gui? For example I want to have a text attribute like "my_extra_name" to be a mandatory information which the user has to supply on creation through the gui. Right now i see two ways for creating new DB instances of my object types but non forces the user to supply my extra data. (The first one at least offers the possibility to directly set the value for a custom attribute and makes i more prominent but it is not mandatory. The Second way does not even offer a direct way for setting any values other then the Name. The user has to select the new instance, open the info-box and fill in additional information there and then save.) Thanks for the help in advance Lukas
  10. lukas g

    Datetime Field ?

    Hi Mattias, the event query tip was very helpful! Thanks a lot for that. Now i am able to compare all DB entries with each other based on their latest update Regarding the arrow date issue. I was not able to get it to work with my custom attribute (But right now i don't rely on the custom date attribute anymore as i am using the nice event query)
  11. lukas g

    Datetime Field ?

    Is there a way to access the information when a database entry has been modified? (at which datetime the entry has been edited)
  12. lukas g

    Datetime Field ?

    Hello, I need to sync parts my ftrack database with parts of my inhouse database. For this reason I need support for a timestamp (Date AND time) which gets updated when a field has last been changed. How can i put datetime information into the ftrack database? The custom_attributes support the date field and if i query it i receive an arrow object. But when i try to set it to a new datetime i can only set it with a date but not with a time information. if i try to set it with time information i get an error: ServerError: Server reported error: IntegrityError(Custom attribute value for "my_time_stamp" must be a valid date. Got '2018-06-28T18:13:14.043000'.) Here is some code snippet: my_object = session.query("MyObjectType where name is MyName").first() my_time_stamp = my_object["custom_attributes"]["my_time_stamp"] log.debug("My Time Stamp: {}".format(my_time_stamp)) # >>> 2018-06-28T00:00:00+00:00 arrow_now = arrow.utcnow() log.debug("Arrow datetime: {}".format(arrow_now.datetime)) # >>> 2018-06-28 18:04:48.799000+00:00 log.debug("Arrow date: {}".format(arrow_now.date())) # >>> 2018-06-28 my_object["custom_attributes"]["my_time_stamp"] = arrow_now.date() I hope someone can guide me to the right direction. Best, Lukas
  13. lukas g

    Query Project Schema Objects

    Maybe there is another way of finding out which object types are assigned to my project so i can prevent a ServerError like this from happening: "ServerError: Server reported error: ValidationError(Object type u'Shot' cannot be created on project u'Lukas Dev'.)" The only solution i found for now i to try to create the desired types on startup to check if i can create them and catch the server error and show it to the TD to properly configure the ftrack project.
  14. lukas g

    Query Project Schema Objects

    Hello, I need to write some checks using the python api to make sure the current ftrack project is configured correctly. There fore i need to query the currents project Project Schema and check its configuration. Specifically: I need to query the assigned Objecty (ObjectTypes) of a Project Schema. I can access the the Types and objects with 'ProjectSchema.get_types()' as well as the statuses an by calling 'ProjectSchema.get_statuses()' but i can't find a way to actually figure out if an object (ObjectType) is assigned to the list of objects of the particular Project Schema. (I can easily find out if a specific object type exists at all using 'session.query("ObjectType where name is my_object_type_name")' but not which schemas it is assigned to.) I know from a different post, that creating new ProjectSchemas and "manage" them (editing them?) is only supported using the GUI. But What about retrieving the assigned Objects (ObjectTypes) ? It should be possible i guess. The Docs from ProjectSchema dont show any more methods: http://ftrack-python-api.rtd.ftrack.com/en/1.4.0/api_reference/entity/project_schema.html Examples for get_types() and get_statuses: http://ftrack-python-api.rtd.ftrack.com/en/1.4.0/example/project.html I Hope someone can help me out. Thank you in advance Lukas
  15. lukas g

    How to create new entity types with python api

    Hi Mattias, thank you for the quick reply and the welcoming That's unfortunate to hear not having access through the api for proper entity configuration. I can see this not being an easy task to tackle, hiding the underlying complexity from the api users but still giving enough control for flexible configurations. Do you have any information about when this might be addressed? (Talking about just a couple of months or more like a year or so?) Best Lukas