1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #9887: Inspect docs_url property to determine link to model documentation

This commit is contained in:
jeremystretch
2022-10-27 09:44:09 -04:00
parent ec4e2a8e16
commit dbe66596f9
5 changed files with 14 additions and 10 deletions

View File

@ -49,6 +49,12 @@ class MyModel(NetBoxModel):
...
```
### NetBoxModel Properties
#### `docs_url`
This attribute specifies the URL at which the documentation for this model can be reached. By default, it will return `/static/docs/models/<app_label>/<model_name>/`. Plugin models can override this to return a custom URL. For example, you might direct the user to your plugin's documentation hosted on [ReadTheDocs](https://readthedocs.org/).
### Enabling Features Individually
If you prefer instead to enable only a subset of these features for a plugin model, NetBox provides a discrete "mix-in" class for each feature. You can subclass each of these individually when defining your model. (Your model will also need to inherit from Django's built-in `Model` class.)