0

finding out what stuff is called

I would say that allot of the time I spend doing development that involves shotgun is actually wasted by me spending time finding out what stuff is called.

 

for example: I see a bit of information in the shotgun gui, and I want my script to read that bit of information.  In the gui, that bit of info is labeled as "Whatever", so I try using 'Whatever' in my script, but it does not exist, I also try "sg_whatever" & "whatever" with no luck.

i try: print sg.schema_field_read('anEntity')  and this returns loads of stuff - none of which has 'whatever' in it.

 

in the end I stumble across some code which gives me the answer, which turns out to be 'something'.

 

what am I doing wrong?

1 comment

  • 0
    Avatar
    Brandon Foster

    Hi Rupert,

    It sounds like you're looking for an easy way to distinguish between the Field Name (the human-readable text labeling the field) and the Field Code (the internal code used by the Shotgun database and the API). There are two ways you can easily look up this information.

    1) For the first, right click the column header and select "configure field." In the configuration dialog, near the top you will see the Field Code next to the Field Name. See attached screenshot.

    2) The second method is through the Admin Gear > Fields menu. This page lists every Field on every active entity on your Shotgun site, along with useful meta-data like the Field Code and type. See attached screenshot for reference.

Please sign in to leave a comment.