# NetBox Attachments Plugin
[Netbox](https://github.com/netbox-community/netbox) plugin for attaching files to any model.
## Features
This plugin provide following Models:
- NetBoxAttachment
## Compatibility
| Netbox | Plugin |
| -------- | --------------- |
| >= 3.3.4 | 0.0.0 <-> 0.0.5 |
| >= 3.4.0 | 0.0.6 <-> 1.0.6 |
| >= 3.4.3 | 1.0.7 <-> 1.1.X |
| >= 3.5.0 | 2.0.0 |
| >= 3.6.0 | 3.0.0 |
| >= 3.7.0 | 4.0.0 |
| >= 4.0.0 | 5.0.0 |
## Installation
The plugin is available as a Python package in pypi and can be installed with pip
```
pip install netbox-attachments
```
Enable the plugin in `configuration.py`:
```
PLUGINS = ['netbox_attachments']
```
Restart NetBox and add `netbox-attachments` to your local_requirements.txt
See [NetBox Documentation](https://docs.netbox.dev/en/stable/plugins/#installing-plugins) for details
## Configuration
The following options are available:
- `apps`:
- **Type**: List
- **Default**: ['dcim', 'ipam', 'circuits', 'tenancy', 'virtualization', 'wireless']
- **Description**: Display `Attachments` feature on all models definded under the app label. Attachmets are displayed on `right_page` of the detail-view of model.
- `display_default`:
- **Type**: String
- **Default**: "additional_tab"
- **Options**: "left_page", "right_page", "full_width_page", "additional_tab"
- **Description**: Setup default setting of where attachments should be displayed under the models
- `display_setting`:
- **Type**: Dict
- **Default**: {}
- **Options**: {<app_label.model>: <prefeered_display>}
- **Example**: {'dcim.devicerole': 'full_width_page', 'dcim.device': 'left_page', 'ipam.vlan': 'additional_tab'}
- **Description**: Set display setting for concrete model
- **Tip**: Proper `app_label` and `model` names could be found at API `<your_netbox_url>/api/extras/content-types/`
> **Warning**
> `additional_tab` does not work for Plugin models
### Configuration Example:
```
PLUGINS_CONFIG = {
'netbox_attachments': {
'apps': ['dcim', 'ipam', 'circuits', 'tenancy', 'virtualization', 'wireless', 'inventory_monitor'],
'display_default': "right_page",
'display_setting': {'ipam.vlan': "left_page", 'dcim.device': "full_width_page", 'dcim.devicerole': "full_width_page", 'inventory_monitor.probe': "additional_tab"}
}
}
```
## Enable Attachments for custom plugin (models)
- Append your plugin to configuration list
- `apps`: ['<plugin_name>']
- Extend detail templates
- ```
# At the TOP
{% load plugins %}
# Under a comments section
{% plugin_right_page object %}
# add the left_page and full_width for future extension
```
* Example (device - core model):
- [load](https://github.com/netbox-community/netbox/blob/c1b7f09530f0293d0f053b8930539b1d174cd03b/netbox/templates/dcim/device.html#L6)
- [left_page](https://github.com/netbox-community/netbox/blob/c1b7f09530f0293d0f053b8930539b1d174cd03b/netbox/templates/dcim/device.html#L149)
- [right_page](https://github.com/netbox-community/netbox/blob/c1b7f09530f0293d0f053b8930539b1d174cd03b/netbox/templates/dcim/device.html#L288)
- [full_with_page](https://github.com/netbox-community/netbox/blob/c1b7f09530f0293d0f053b8930539b1d174cd03b/netbox/templates/dcim/device.html#L293)
## Screenshots
- Model View
![Platform attachments](docs/img/platform.png)
- List View
![List View](docs/img/list.PNG)
- Detail View
![Detail View](docs/img/detail.PNG)
Raw data
{
"_id": null,
"home_page": "https://github.com/Kani999/netbox-attachments",
"name": "netbox-attachments",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "netbox, netbox-plugin",
"author": "Jan Krupa",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/74/56/84830761b45ef3a6328a47ce96df27ffcb3b0539f1b2dba41ab27f1fdbc0/netbox_attachments-5.0.0.tar.gz",
"platform": null,
"description": "# NetBox Attachments Plugin\n\n[Netbox](https://github.com/netbox-community/netbox) plugin for attaching files to any model.\n\n## Features\n\nThis plugin provide following Models:\n\n- NetBoxAttachment\n\n## Compatibility\n\n| Netbox | Plugin |\n| -------- | --------------- |\n| >= 3.3.4 | 0.0.0 <-> 0.0.5 |\n| >= 3.4.0 | 0.0.6 <-> 1.0.6 |\n| >= 3.4.3 | 1.0.7 <-> 1.1.X |\n| >= 3.5.0 | 2.0.0 |\n| >= 3.6.0 | 3.0.0 |\n| >= 3.7.0 | 4.0.0 |\n| >= 4.0.0 | 5.0.0 |\n\n## Installation\n\nThe plugin is available as a Python package in pypi and can be installed with pip\n\n```\npip install netbox-attachments\n```\n\nEnable the plugin in `configuration.py`:\n\n```\nPLUGINS = ['netbox_attachments']\n```\n\nRestart NetBox and add `netbox-attachments` to your local_requirements.txt\n\nSee [NetBox Documentation](https://docs.netbox.dev/en/stable/plugins/#installing-plugins) for details\n\n## Configuration\n\nThe following options are available:\n\n- `apps`:\n - **Type**: List\n - **Default**: ['dcim', 'ipam', 'circuits', 'tenancy', 'virtualization', 'wireless']\n - **Description**: Display `Attachments` feature on all models definded under the app label. Attachmets are displayed on `right_page` of the detail-view of model.\n- `display_default`:\n - **Type**: String\n - **Default**: \"additional_tab\"\n - **Options**: \"left_page\", \"right_page\", \"full_width_page\", \"additional_tab\"\n - **Description**: Setup default setting of where attachments should be displayed under the models\n- `display_setting`:\n - **Type**: Dict\n - **Default**: {}\n - **Options**: {<app_label.model>: <prefeered_display>}\n - **Example**: {'dcim.devicerole': 'full_width_page', 'dcim.device': 'left_page', 'ipam.vlan': 'additional_tab'}\n - **Description**: Set display setting for concrete model\n - **Tip**: Proper `app_label` and `model` names could be found at API `<your_netbox_url>/api/extras/content-types/`\n\n> **Warning**\n> `additional_tab` does not work for Plugin models\n\n### Configuration Example:\n\n```\nPLUGINS_CONFIG = {\n 'netbox_attachments': {\n 'apps': ['dcim', 'ipam', 'circuits', 'tenancy', 'virtualization', 'wireless', 'inventory_monitor'],\n 'display_default': \"right_page\",\n 'display_setting': {'ipam.vlan': \"left_page\", 'dcim.device': \"full_width_page\", 'dcim.devicerole': \"full_width_page\", 'inventory_monitor.probe': \"additional_tab\"}\n }\n}\n```\n\n## Enable Attachments for custom plugin (models)\n\n- Append your plugin to configuration list\n - `apps`: ['<plugin_name>']\n- Extend detail templates\n - ```\n # At the TOP\n {% load plugins %}\n # Under a comments section\n {% plugin_right_page object %}\n # add the left_page and full_width for future extension\n ```\n * Example (device - core model):\n - [load](https://github.com/netbox-community/netbox/blob/c1b7f09530f0293d0f053b8930539b1d174cd03b/netbox/templates/dcim/device.html#L6)\n - [left_page](https://github.com/netbox-community/netbox/blob/c1b7f09530f0293d0f053b8930539b1d174cd03b/netbox/templates/dcim/device.html#L149)\n - [right_page](https://github.com/netbox-community/netbox/blob/c1b7f09530f0293d0f053b8930539b1d174cd03b/netbox/templates/dcim/device.html#L288)\n - [full_with_page](https://github.com/netbox-community/netbox/blob/c1b7f09530f0293d0f053b8930539b1d174cd03b/netbox/templates/dcim/device.html#L293)\n\n## Screenshots\n\n- Model View\n ![Platform attachments](docs/img/platform.png)\n- List View\n ![List View](docs/img/list.PNG)\n- Detail View\n ![Detail View](docs/img/detail.PNG)\n",
"bugtrack_url": null,
"license": null,
"summary": "Netbox plugin to manage attachments for any model",
"version": "5.0.0",
"project_urls": {
"Homepage": "https://github.com/Kani999/netbox-attachments"
},
"split_keywords": [
"netbox",
" netbox-plugin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4f0e684af23b563760cbf2cc39d1c3728d673d76fff33dd26b9d6ac7a7df1c6e",
"md5": "68f4d39ea667c6785ca982998c900d78",
"sha256": "1c106650737b2bef00805f348b03dd014256fc5714fbe51ec5a0047dd2427f13"
},
"downloads": -1,
"filename": "netbox_attachments-5.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "68f4d39ea667c6785ca982998c900d78",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 20157,
"upload_time": "2024-05-21T09:26:01",
"upload_time_iso_8601": "2024-05-21T09:26:01.349240Z",
"url": "https://files.pythonhosted.org/packages/4f/0e/684af23b563760cbf2cc39d1c3728d673d76fff33dd26b9d6ac7a7df1c6e/netbox_attachments-5.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "745684830761b45ef3a6328a47ce96df27ffcb3b0539f1b2dba41ab27f1fdbc0",
"md5": "c09bd1e2328fbed2a748f2b103ec4b89",
"sha256": "044e2c597f2c9cde3e58b19e433ad6c000df3dc580f4a90280ed6c324827ace8"
},
"downloads": -1,
"filename": "netbox_attachments-5.0.0.tar.gz",
"has_sig": false,
"md5_digest": "c09bd1e2328fbed2a748f2b103ec4b89",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 13595,
"upload_time": "2024-05-21T09:26:03",
"upload_time_iso_8601": "2024-05-21T09:26:03.204188Z",
"url": "https://files.pythonhosted.org/packages/74/56/84830761b45ef3a6328a47ce96df27ffcb3b0539f1b2dba41ab27f1fdbc0/netbox_attachments-5.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-21 09:26:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Kani999",
"github_project": "netbox-attachments",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "netbox-attachments"
}