0

Fields with None value

I'm trying to fill a PyQt form with data from Shotgun, but sometimes there are empty fields, so a "find_one" returns "None" and Python gives me an error message. Is there a way to convert this None value to a string, or a way to filter all the fields which return None?

Thank you in advance

1件のコメント

  • 0
    Avatar
    Isaac Reuben

    Sergio,

    What if you get the values back from Shotgun, and then loop through to convert None to "", or whatever else you need to do to get the data into the format that the PyQt form expects?  Would be something like:

    for key in returned_data.keys():
    	if returned_data[key] is None:
    		returned_data[key] = ""

    Cheers,

    - Isaac

ログインしてコメントを残してください。