0

Shotgun Wrapper Attribute Procedure

The shotgun wrapper needs an attribute query procedure.  We use python and QT to build UI's and it would be nice to include in your shotgun wrapper a procedure to query a field and return valid values.  Typically we would use this to populate a list box with valid values from a list field from shotgun.

 

-Romey

2 comments

  • 0
    Avatar
    Isaac Reuben

    Romey, check out the schema(<entity_name>) method.  That will print out a list of all the fields for that entity, showing their display name (nice to use in your GUI to sync things up with the display name in Shotgun), whether they are editable or not, and for list fields...  the list of valid options!  Here is an example for the status field on Task:

     

     'sg_status_list': {'data_type': 'status_list',
                        'display_name': 'Status',
                        'editable': True,
                        'valid_options': ['fin',
                                          'gmr',
                                          'gma',
                                          'ip',
                                          'inr',
                                          'hld',
                                          'rdy',
                                          'wtg']}

    All the details on the python api can be found here:  https://shotgunsoftware.zendesk.com/forums/48807/entries

  • 0
    Avatar
    Mike Romey

    Thats great.  Didn't realize the schema method existed.  I was looking for some type of attribute method.  None the less, I will be retooling my temporary method to use the shotgun schema method this week now that I know it's avaliable.

    -Romey

Please sign in to leave a comment.