Add content to existing model templates -> how? #12780
-
Hi, I am probably missing something basic while reading the documentation. In the getting started section it states "Add content to existing model templates" eg: I have a model and I assume that I get all this working (with the very good and impressive documentation). I've got create edit table views/templates just like de documentation. The model is a "child" of the core model VM ( VM has one or more the new models). The documentation says I can inject a template in a core model. So I should be able to inject a list of the models in the VM template? I was wondering if this is described somewhere? The plugin tutorial seems to contain the plugin to it's models it self. Sources: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
No. It means you can add content to the views of an existing core model - such as data from your plugin's own models, which relates to an existing model. But you cannot modify the core models themselves. For example: if you have a Foo model, which contains a reference to Device, then when viewing a Device you can also show the related Foos by adding content into the Device view. But this does not change the Device model. |
Beta Was this translation helpful? Give feedback.
I think what you need is here: https://docs.netbox.dev/en/stable/plugins/development/views/#extending-core-views