-
I have inherited legacy software that connects to the NB database directly. I need to update it to work with the latest netbox version and I'm having a hard time wrapping my head around the new structure of custom fields. I've surmised that custom fields are stored in My question is what is the object_type_id? What table holds more info about the object_types? How can there be custom fields on object 3 that aren't related to site 3? For reference here is the 2.* query that I need to update
Ultimately I need to be able to get all custom fields and their values for a site when given the ID of that site. Any help is appreciated. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Custom field values are stored on each row, in a JSONB column named |
Beta Was this translation helpful? Give feedback.
-
It's much simpler in modern versions of Netbox: all you need is
FWIW, that's in table |
Beta Was this translation helpful? Give feedback.
It's much simpler in modern versions of Netbox: all you need is
FWIW, that's in table
django_content_type
. You might need to use it when dealing with generic foreign keys, with a pair of(assigned_object_type_id, assigned_object_id)