Schema editing API and renaming Custom Entities

Is there an API which allows renaming CustomEntities? The “display names” of custom entities look like they exist outside of the DB?

1 Like

Hi @Rhea_Fischer,

Unfortunately the CustomEntity DB names are not re-nameable, and I would suggest putting in a feature request, but I don’t see this getting changed (due to technical db reasons) anytime soon or at all.

Sorry I can’t help more!

-David

Thanks for your reply @DavidMason. I wasn’t really clear however.

I’d like to know if there’s an API to change the entity display name as is done through the Admin: Site preferences page on our Shotgun site.

I do understand that the names in the postgres schema can’t change (as they don’t even when the “display name” is changed in site preferences.

Hi @Rhea_Fischer,

Sorry for the confusion, Yes, you can change the name of a field using the schema_field_update() function.

As an example, I changed the name of the code field for CustomEntity01 like this;

properties = {"name": "New Custom Name",}
sg.schema_field_update("CustomEntity01", "code", properties)

Just by following the example in the link above. You can get the properties of any field with the schema_field_read() command.

-David

2 Likes

Thanks David!

Using this with extended manifest data in tk-framework-perforce. It supports a script which conforms custom entities and fields as needed (with appropriate warnings).