diff --git a/index.html b/index.html index 1a55b24..edf288c 100644 --- a/index.html +++ b/index.html @@ -68,7 +68,7 @@
(venv) $ cd /opt/netbox/netbox/
(venv) $ python3 manage.py migrate
The pluggin adds contracts and invoices model to Netbox. It allows to register contract with objects. Add invoices to contracts.
"},{"location":"#installation","title":"Installation","text":""},{"location":"#activate-venv","title":"Activate venv","text":"To ensure our plugin is accessible to the NetBox installation, we first need to activate the Python virtual environment that was created when we installed NetBox. To do this, determine the virtual environment's path (this will be /opt/netbox/venv/
if you use the documentation's defaults) and activate it:
$ source /opt/netbox/venv/bin/activate\n
"},{"location":"#install-the-package","title":"Install the package","text":"$ python3 -m pip install netbox-contract\n
"},{"location":"#configure-netbox","title":"Configure NetBox","text":"Finally, we need to configure NetBox to enable our new plugin. Over in the NetBox installation path, open netbox/netbox/configuration.py
and look for the PLUGINS
parameter; this should be an empty list. (If it's not yet defined, go ahead and create it.) Add the name of our plugin to this list:
# configuration.py\nPLUGINS = [\n 'netbox_contract',\n]\n
"},{"location":"#customize-the-plugin","title":"Customize the plugin","text":"The following configurationitems can be set:
# configuration.py\nPLUGINS_CONFIG = {\n 'netbox_contract': {\n 'top_level_menu': True,\n 'default_accounting_dimensions':{\n \"account\": \"\", \n \"project\": \"\", \n \"cost center\": \"\"\n },\n 'mandatory_contract_fields': ['accounting_dimensions'],\n 'hidden_contract_fields': [],\n 'mandatory_invoice_fields': ['accounting_dimensions'],\n 'hidden_invoice_fields': [],\n }\n}\n
Internal partie reference the legal entity of your organization that is a partie to the contract.
# configuration.py\nFIELD_CHOICES = {\n 'netbox_contract.Contract.internal_partie': (\n ('Nagravision SARL', 'Nagravision SARL', 'green'),\n ('Nagra USA', 'Nagra USA', 'green'),\n ('Nagra India', 'Nagra India', 'green'),\n ),\n 'netbox_contract.Contract.currency': (\n ('usd', 'USD'),\n ('eur', 'EUR'),\n ('chf', 'CHF'),\n ('pln', 'PLN'),\n ),\n 'netbox_contract.Contract.status': (\n ('Active', 'Active', 'green'),\n ('Cancled', 'Canceled', 'red'),\n )\n}\n
"},{"location":"#run-database-migrations","title":"Run database migrations","text":"(venv) $ cd /opt/netbox/netbox/\n(venv) $ python3 manage.py migrate\n
"},{"location":"changelog/","title":"Changelog","text":""},{"location":"changelog/#changelog","title":"Changelog","text":""},{"location":"changelog/#unreleased","title":"[Unreleased]","text":""},{"location":"changelog/#version-21","title":"Version 2.1","text":""},{"location":"changelog/#version-210","title":"Version 2.1.0","text":"Add support for Netbox 3.5 which become the minimum version supported to accomodate the removal of NetBoxModelCSVForm class (replaced by NetBoxModelImportForm) .
"},{"location":"changelog/#version-201","title":"Version 2.0.1","text":"Add support contract assignement panel to devices.
"},{"location":"changelog/#version-200","title":"Version 2.0.0","text":"Add a new contract asignement model to allow the assignement of contract not only to Circuits. The support for the direct Contract to Circuit relation will be removed in version 2.1.0 . In Order to migrate existing relations contract_migration.py script is provided and can be run from the django shell.
"},{"location":"contributing/","title":"Contributing","text":""},{"location":"contributing/#contributing","title":"Contributing","text":"Contributions are welcome!
"},{"location":"contributing/#types-of-contributions","title":"Types of contributions","text":""},{"location":"contributing/#report-bugs-or-submit-feedback","title":"Report bugs or submit feedback","text":"Report bugs and submit feetback here.
"},{"location":"contributing/#fix-bugs","title":"Fix bugs","text":"Look through the GitHub issues for bugs. Anything tagged with \"bug\" and \"help wanted\" is open to whoever wants to implement it.
"},{"location":"contributing/#implement-features","title":"Implement features","text":"Look through the GitHub issues for features. Anything tagged with \"enhancement\" and \"help wanted\" is open to whoever wants to implement it.
"},{"location":"contributing/#coding-conventions","title":"Coding conventions","text":"Netbox Style Guide Django Coding style
For this: All files will be formated using the black auto-formatter. Configuration is stored in pyproject.toml
isort is used to automate import sorting.
Linting and PEP8 style enforcement will be done with Flake8 which is a wrapper arround: - PyFlakes - pycodestyle - Ned Batchelder\u2019s McCabe script Configuration is maintained in the .flake8 file (no support for pyproject.toml)
The pre-commit Python framework is used to simplify the managment of pre-commit hooks. Config is stored in .pre-commit-config.yaml
"},{"location":"contributing/#repository-structure","title":"Repository structure","text":"There are 2 permanent branch in the repository:
For each new feature or bug fix a branch is created from the corresponding issue.
"},{"location":"contributing/#setup-your-development-environment","title":"Setup your development environment","text":"python -m pip install pre-commit\npre-commit install\n
1. Install Netbox. Make sure taht at the Netbox installtion step you follow the \"Option B: Clone the Git Repository\" From the Netbox directory you activate the NetBox virtual environment
$ cd netbox\n$ source venv/netbox/bin/activate\n
Fork the netbox-contract repo on GitHub.
Clone your fork locally
$ cd ..\n$ git clone git@github.com:your_name_here/netbox-contract.git\n
Add the plugin to NetBox virtual environment:
$ python3 -m pip install -e netbox-contract\n
Update the Netbox configuration ans run the database migrations as mentionned in the plugin installation steps.
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature\n
Make your changes locally.
You can test your changes using the django development server:
$ python3 netbox/netbox/manage.py runserver 0.0.0.0:8000 --insecure\n
Connect to the name or IP of the server (as defined in ALLOWED_HOSTS) on port 8000; for example, http://127.0.0.1:8000/.
Commit your changes and push your branch to GitHub:
$ git add .\n$ git commit -m \"Your detailed description of your changes.\"\n$ git push origin name-of-your-bugfix-or-feature\n
Submit a pull request through the GitHub website.
Before you submit a pull request, check that it meets these guidelines:
A reminder for the maintainers on how to deploy. Make sure all your changes are committed (including an entry in CHANGELOG.md) and that all tests pass. Then in the github project go to Releases
and create a new release with a new tag. This will automatically upload the release to pypi:
The pluggin adds contracts and invoices model to Netbox. It allows to register contract with objects. Add invoices to contracts.
Check the documentation for additional information
"},{"location":"#installation","title":"Installation","text":""},{"location":"#activate-venv","title":"Activate venv","text":"To ensure our plugin is accessible to the NetBox installation, we first need to activate the Python virtual environment that was created when we installed NetBox. To do this, determine the virtual environment's path (this will be /opt/netbox/venv/
if you use the documentation's defaults) and activate it:
$ source /opt/netbox/venv/bin/activate\n
"},{"location":"#install-the-package","title":"Install the package","text":"$ python3 -m pip install netbox-contract\n
"},{"location":"#configure-netbox","title":"Configure NetBox","text":"Finally, we need to configure NetBox to enable our new plugin. Over in the NetBox installation path, open netbox/netbox/configuration.py
and look for the PLUGINS
parameter; this should be an empty list. (If it's not yet defined, go ahead and create it.) Add the name of our plugin to this list:
# configuration.py\nPLUGINS = [\n 'netbox_contract',\n]\n
"},{"location":"#customize-the-plugin","title":"Customize the plugin","text":"The following configurationitems can be set:
# configuration.py\nPLUGINS_CONFIG = {\n 'netbox_contract': {\n 'top_level_menu': True,\n 'default_accounting_dimensions':{\n \"account\": \"\", \n \"project\": \"\", \n \"cost center\": \"\"\n },\n 'mandatory_contract_fields': ['accounting_dimensions'],\n 'hidden_contract_fields': [],\n 'mandatory_invoice_fields': ['accounting_dimensions'],\n 'hidden_invoice_fields': [],\n }\n}\n
Internal partie reference the legal entity of your organization that is a partie to the contract.
# configuration.py\nFIELD_CHOICES = {\n 'netbox_contract.Contract.internal_partie': (\n ('Nagravision SARL', 'Nagravision SARL', 'green'),\n ('Nagra USA', 'Nagra USA', 'green'),\n ('Nagra India', 'Nagra India', 'green'),\n ),\n 'netbox_contract.Contract.currency': (\n ('usd', 'USD'),\n ('eur', 'EUR'),\n ('chf', 'CHF'),\n ('pln', 'PLN'),\n ),\n 'netbox_contract.Contract.status': (\n ('Active', 'Active', 'green'),\n ('Cancled', 'Canceled', 'red'),\n )\n}\n
"},{"location":"#run-database-migrations","title":"Run database migrations","text":"(venv) $ cd /opt/netbox/netbox/\n(venv) $ python3 manage.py migrate\n
"},{"location":"changelog/","title":"Changelog","text":""},{"location":"changelog/#changelog","title":"Changelog","text":""},{"location":"changelog/#unreleased","title":"[Unreleased]","text":""},{"location":"changelog/#version-21","title":"Version 2.1","text":""},{"location":"changelog/#version-210","title":"Version 2.1.0","text":"Add support for Netbox 3.5 which become the minimum version supported to accomodate the removal of NetBoxModelCSVForm class (replaced by NetBoxModelImportForm) .
"},{"location":"changelog/#version-201","title":"Version 2.0.1","text":"Add support contract assignement panel to devices.
"},{"location":"changelog/#version-200","title":"Version 2.0.0","text":"Add a new contract asignement model to allow the assignement of contract not only to Circuits. The support for the direct Contract to Circuit relation will be removed in version 2.1.0 . In Order to migrate existing relations contract_migration.py script is provided and can be run from the django shell.
"},{"location":"contributing/","title":"Contributing","text":""},{"location":"contributing/#contributing","title":"Contributing","text":"Contributions are welcome!
"},{"location":"contributing/#types-of-contributions","title":"Types of contributions","text":""},{"location":"contributing/#report-bugs-or-submit-feedback","title":"Report bugs or submit feedback","text":"Report bugs and submit feetback here.
"},{"location":"contributing/#fix-bugs","title":"Fix bugs","text":"Look through the GitHub issues for bugs. Anything tagged with \"bug\" and \"help wanted\" is open to whoever wants to implement it.
"},{"location":"contributing/#implement-features","title":"Implement features","text":"Look through the GitHub issues for features. Anything tagged with \"enhancement\" and \"help wanted\" is open to whoever wants to implement it.
"},{"location":"contributing/#coding-conventions","title":"Coding conventions","text":"Netbox Style Guide Django Coding style
For this: All files will be formated using the black auto-formatter. Configuration is stored in pyproject.toml
isort is used to automate import sorting.
Linting and PEP8 style enforcement will be done with Flake8 which is a wrapper arround: - PyFlakes - pycodestyle - Ned Batchelder\u2019s McCabe script Configuration is maintained in the .flake8 file (no support for pyproject.toml)
The pre-commit Python framework is used to simplify the managment of pre-commit hooks. Config is stored in .pre-commit-config.yaml
"},{"location":"contributing/#repository-structure","title":"Repository structure","text":"There are 2 permanent branch in the repository:
For each new feature or bug fix a branch is created from the corresponding issue.
"},{"location":"contributing/#setup-your-development-environment","title":"Setup your development environment","text":"python -m pip install pre-commit\npre-commit install\n
1. Install Netbox. Make sure taht at the Netbox installtion step you follow the \"Option B: Clone the Git Repository\" From the Netbox directory you activate the NetBox virtual environment
$ cd netbox\n$ source venv/netbox/bin/activate\n
Fork the netbox-contract repo on GitHub.
Clone your fork locally
$ cd ..\n$ git clone git@github.com:your_name_here/netbox-contract.git\n
Add the plugin to NetBox virtual environment:
$ python3 -m pip install -e netbox-contract\n
Update the Netbox configuration ans run the database migrations as mentionned in the plugin installation steps.
Create a branch for local development:
$ git checkout -b name-of-your-bugfix-or-feature\n
Make your changes locally.
You can test your changes using the django development server:
$ python3 netbox/netbox/manage.py runserver 0.0.0.0:8000 --insecure\n
Connect to the name or IP of the server (as defined in ALLOWED_HOSTS) on port 8000; for example, http://127.0.0.1:8000/.
Commit your changes and push your branch to GitHub:
$ git add .\n$ git commit -m \"Your detailed description of your changes.\"\n$ git push origin name-of-your-bugfix-or-feature\n
Submit a pull request through the GitHub website.
Before you submit a pull request, check that it meets these guidelines:
A reminder for the maintainers on how to deploy. Make sure all your changes are committed (including an entry in CHANGELOG.md) and that all tests pass. Then in the github project go to Releases
and create a new release with a new tag. This will automatically upload the release to pypi: