0

using find_one() to get sequence id

im keeping it as simple as possible but still dont know where im going wrong. 

im trying to get a sequence id using;

episode = '107'

sequence = '02'

seqFilters = 'name','is',episode+'_'+sequence

sgSeq = sg.find_one('Sequence', seqFilters)

 

i know sequence 107_02 exists, but i keep getting the error:

--------------------------------------------------------------------------------

 

# XMLRPC Fault 103:

# # API read() invalid/missing hash 'filters' (general condition):

# {"paging"=>{"entities_per_page"=>1, "current_page"=>1},

# "return_fields"=>["id"],

# "type"=>"Sequence",

# "filters"=>["name", "is", "107_02"],

# "return_only"=>"active",

"return_paging_info"=>false}#

--------------------------------------------------------------------------------

# Error: Fault: file T:/hhh/cg/scripts/shotgunConnect\shotgun_api3.py line 1659: #

 

im still new to this, was wondering if anyone could shed some light?

 

thanks,

Lee

2 comments

  • 0
    Avatar
    Lee

    looks like i cant use 'name' with a sequence, still unsure how to find a sequence id number if the sequence is called 107_02

  • 0
    Avatar
    Nephi Sanchez

    Hi Lee,

     

    Try this for your filter syntax:

     

    seqFilters = [ [ 'code','is',episode+'_'+sequence ] ]

     

    Some entities have 'code', some have 'name', (I know, inconsistent), so to know which one it is for sure, right+click on the column header and then select 'configure' and then you can see what you should be using.

    Screen_shot_2011-09-08_at_11.18.49_AM.png

     

    Also note that the filter should be a list object, with one or more lists inside, thus the double brackets.

     

    Don't know if you have seen this, but here's a handy link that you may want to bookmark:

    https://github.com/shotgunsoftware/python-api/wiki

     

    Gives a pretty good run-through of the syntax for using the API.   Let us know if you run into any more snags, we'll get you up and running!

     

    Cheers,
    Nephi 

Please sign in to leave a comment.