netbox-contract 2.0.0__tar.gz → 2.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {netbox-contract-2.0.0/src/netbox_contract.egg-info → netbox-contract-2.0.2}/PKG-INFO +15 -1
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/README.md +15 -1
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/pyproject.toml +1 -1
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/__init__.py +2 -2
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/forms.py +6 -6
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/tables.py +32 -2
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/template_content.py +17 -2
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/views.py +1 -1
- {netbox-contract-2.0.0 → netbox-contract-2.0.2/src/netbox_contract.egg-info}/PKG-INFO +15 -1
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/LICENSE +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/MANIFEST.in +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/setup.cfg +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/setup.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/api/__init__.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/api/serializers.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/api/urls.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/api/views.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/filtersets.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0001_initial.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0002_alter_contract_circuit_and_more.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0003_alter_contract_custom_field_data_and_more.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0004_contract_currency_invoice_currency.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0005_contract_accounting_dimensions_and_more.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0006_alter_contract_circuit.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0007_invoice_date.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0008_invoice_comments.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0009_contract_external_reference.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0010_invoice_contracts.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0011_auto_20230122_2112.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0012_remove_invoice_contract.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0013_contract_documents_invoice_documents.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0014_contract_end_date.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0015_contractassignement.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/__init__.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/models.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/navigation.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/search.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/templates/contract_assignements_bottom.html +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/templates/contract_list_bottom.html +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/templates/netbox_contract/contract.html +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/templates/netbox_contract/contract_assignement.html +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/templates/netbox_contract/invoice.html +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/templates/netbox_contract/serviceprovider.html +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/urls.py +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract.egg-info/SOURCES.txt +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract.egg-info/dependency_links.txt +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract.egg-info/not-zip-safe +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract.egg-info/requires.txt +0 -0
- {netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: netbox-contract
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: Contract management plugin for Netbox
|
|
5
5
|
Author-email: Marc Lebreuil <marc@famillelebreuil.net>
|
|
6
6
|
Project-URL: Homepage, https://github.com/mlebreuil/netbox-contract
|
|
@@ -78,3 +78,17 @@ FIELD_CHOICES = {
|
|
|
78
78
|
(venv) $ cd /opt/netbox/netbox/
|
|
79
79
|
(venv) $ python3 manage.py migrate
|
|
80
80
|
```
|
|
81
|
+
|
|
82
|
+
## release notes
|
|
83
|
+
|
|
84
|
+
### version 2.0.0
|
|
85
|
+
|
|
86
|
+
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.
|
|
87
|
+
|
|
88
|
+
#### version 2.0.1
|
|
89
|
+
|
|
90
|
+
Add support contract assignement panel to devices.
|
|
91
|
+
|
|
92
|
+
#### version 2.0.2
|
|
93
|
+
|
|
94
|
+
Add support for Netbox 3.5 whcih become the minimum version supported to accoodate the removal of NetBoxModelCSVForm class (replaced by NetBoxModelImportForm) .
|
|
@@ -63,4 +63,18 @@ FIELD_CHOICES = {
|
|
|
63
63
|
```bash
|
|
64
64
|
(venv) $ cd /opt/netbox/netbox/
|
|
65
65
|
(venv) $ python3 manage.py migrate
|
|
66
|
-
```
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## release notes
|
|
69
|
+
|
|
70
|
+
### version 2.0.0
|
|
71
|
+
|
|
72
|
+
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.
|
|
73
|
+
|
|
74
|
+
#### version 2.0.1
|
|
75
|
+
|
|
76
|
+
Add support contract assignement panel to devices.
|
|
77
|
+
|
|
78
|
+
#### version 2.0.2
|
|
79
|
+
|
|
80
|
+
Add support for Netbox 3.5 whcih become the minimum version supported to accoodate the removal of NetBoxModelCSVForm class (replaced by NetBoxModelImportForm) .
|
|
@@ -4,11 +4,11 @@ class ContractsConfig(PluginConfig):
|
|
|
4
4
|
name = 'netbox_contract'
|
|
5
5
|
verbose_name = 'Netbox contract'
|
|
6
6
|
description = 'Contract management plugin for Netbox'
|
|
7
|
-
version = '2.0.
|
|
7
|
+
version = '2.0.2'
|
|
8
8
|
author = 'Marc Lebreuil'
|
|
9
9
|
author_email = 'marc@famillelebreuil.net'
|
|
10
10
|
base_url = 'contracts'
|
|
11
|
-
min_version = "3.
|
|
11
|
+
min_version = "3.5.0"
|
|
12
12
|
required_settings = []
|
|
13
13
|
default_settings = {
|
|
14
14
|
'top_level_menu': False,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from django import forms
|
|
2
2
|
import django_filters
|
|
3
|
-
from netbox.forms import NetBoxModelForm, NetBoxModelFilterSetForm, NetBoxModelBulkEditForm,
|
|
4
|
-
from utilities.forms.fields import CommentField, DynamicModelChoiceField, DynamicModelMultipleChoiceField, MultipleChoiceField
|
|
5
|
-
from utilities.forms import
|
|
3
|
+
from netbox.forms import NetBoxModelForm, NetBoxModelFilterSetForm, NetBoxModelBulkEditForm, NetBoxModelImportForm
|
|
4
|
+
from utilities.forms.fields import CommentField, DynamicModelChoiceField, DynamicModelMultipleChoiceField, MultipleChoiceField, CSVModelChoiceField, SlugField
|
|
5
|
+
from utilities.forms.widgets import DatePicker
|
|
6
6
|
from extras.filters import TagFilter
|
|
7
7
|
from circuits.models import Circuit
|
|
8
8
|
from .models import Contract, Invoice, ServiceProvider, StatusChoices, ContractAssignement
|
|
@@ -72,7 +72,7 @@ class InvoiceFilterSetForm(NetBoxModelFilterSetForm):
|
|
|
72
72
|
required=False
|
|
73
73
|
)
|
|
74
74
|
|
|
75
|
-
class ContractCSVForm(
|
|
75
|
+
class ContractCSVForm(NetBoxModelImportForm):
|
|
76
76
|
circuit = CSVModelChoiceField(
|
|
77
77
|
queryset=Circuit.objects.all(),
|
|
78
78
|
to_field_name='name',
|
|
@@ -114,7 +114,7 @@ class ContractBulkEditForm(NetBoxModelBulkEditForm):
|
|
|
114
114
|
)
|
|
115
115
|
model = Contract
|
|
116
116
|
|
|
117
|
-
class InvoiceCSVForm(
|
|
117
|
+
class InvoiceCSVForm(NetBoxModelImportForm):
|
|
118
118
|
contracts = CSVModelChoiceField(
|
|
119
119
|
queryset=Contract.objects.all(),
|
|
120
120
|
to_field_name='name',
|
|
@@ -154,7 +154,7 @@ class ServiceProviderFilterSetForm(NetBoxModelFilterSetForm):
|
|
|
154
154
|
model = ServiceProvider
|
|
155
155
|
tag = TagFilter()
|
|
156
156
|
|
|
157
|
-
class ServiceProviderCSVForm(
|
|
157
|
+
class ServiceProviderCSVForm(NetBoxModelImportForm):
|
|
158
158
|
slug = SlugField()
|
|
159
159
|
comments = CommentField()
|
|
160
160
|
class Meta:
|
|
@@ -21,8 +21,38 @@ class ContractAssignementListTable(NetBoxTable):
|
|
|
21
21
|
|
|
22
22
|
class Meta(NetBoxTable.Meta):
|
|
23
23
|
model = ContractAssignement
|
|
24
|
-
fields = ('pk', 'content_type', 'content_object', 'contract', 'actions')
|
|
25
|
-
default_columns = ('pk', 'content_type', 'content_object', 'contract')
|
|
24
|
+
fields = ('pk', 'content_type', 'content_object', 'contract','contract__external_partie', 'actions')
|
|
25
|
+
default_columns = ('pk', 'content_type', 'content_object', 'contract','contract__external_partie')
|
|
26
|
+
|
|
27
|
+
class ContractAssignementObjectTable(NetBoxTable):
|
|
28
|
+
contract = tables.Column(
|
|
29
|
+
linkify=True
|
|
30
|
+
)
|
|
31
|
+
actions = columns.ActionsColumn(
|
|
32
|
+
actions=('edit', 'delete')
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
class Meta(NetBoxTable.Meta):
|
|
36
|
+
model = ContractAssignement
|
|
37
|
+
fields = ('pk','contract','contract__external_partie','contract__status', 'actions')
|
|
38
|
+
default_columns = ('pk', 'contract','contract__external_partie','contract__status')
|
|
39
|
+
|
|
40
|
+
class ContractAssignementContractTable(NetBoxTable):
|
|
41
|
+
content_type = columns.ContentTypeColumn(
|
|
42
|
+
verbose_name='Object Type'
|
|
43
|
+
)
|
|
44
|
+
content_object = tables.Column(
|
|
45
|
+
linkify=True,
|
|
46
|
+
orderable=False
|
|
47
|
+
)
|
|
48
|
+
actions = columns.ActionsColumn(
|
|
49
|
+
actions=('edit', 'delete')
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
class Meta(NetBoxTable.Meta):
|
|
53
|
+
model = ContractAssignement
|
|
54
|
+
fields = ('pk', 'content_type', 'content_object','actions')
|
|
55
|
+
default_columns = ('pk', 'content_type', 'content_object')
|
|
26
56
|
|
|
27
57
|
class ContractListTable(NetBoxTable):
|
|
28
58
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from django.contrib.contenttypes.models import ContentType
|
|
2
2
|
from extras.plugins import PluginTemplateExtension
|
|
3
3
|
from circuits.models import Circuit
|
|
4
|
+
from dcim.models import Device
|
|
4
5
|
from .models import ContractAssignement
|
|
5
6
|
from . import tables
|
|
6
7
|
|
|
@@ -23,11 +24,25 @@ class CircuitContractAssignements(PluginTemplateExtension):
|
|
|
23
24
|
circuit = self.context['object']
|
|
24
25
|
circuit_type = ContentType.objects.get_for_model(Circuit)
|
|
25
26
|
contract_assignements = ContractAssignement.objects.filter(content_type__pk=circuit_type.id, object_id=circuit.id)
|
|
26
|
-
assignements_table = tables.
|
|
27
|
+
assignements_table = tables.ContractAssignementObjectTable(contract_assignements)
|
|
27
28
|
assignements_table.configure(self.context['request'])
|
|
28
29
|
|
|
29
30
|
return self.render('contract_assignements_bottom.html', extra_context={
|
|
30
31
|
'assignements_table': assignements_table,
|
|
31
32
|
})
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
class DeviceContractAssignements(PluginTemplateExtension):
|
|
35
|
+
model = 'dcim.device'
|
|
36
|
+
|
|
37
|
+
def full_width_page(self):
|
|
38
|
+
device = self.context['object']
|
|
39
|
+
device_type = ContentType.objects.get_for_model(Device)
|
|
40
|
+
contract_assignements = ContractAssignement.objects.filter(content_type__pk=device_type.id, object_id=device.id)
|
|
41
|
+
assignements_table = tables.ContractAssignementObjectTable(contract_assignements)
|
|
42
|
+
assignements_table.configure(self.context['request'])
|
|
43
|
+
|
|
44
|
+
return self.render('contract_assignements_bottom.html', extra_context={
|
|
45
|
+
'assignements_table': assignements_table,
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
template_extensions = [ CircuitContracts, CircuitContractAssignements, DeviceContractAssignements]
|
|
@@ -85,7 +85,7 @@ class ContractView(generic.ObjectView):
|
|
|
85
85
|
invoices_table.configure(request)
|
|
86
86
|
circuit_table = tables.ContractCircuitListTable(instance.circuit.all())
|
|
87
87
|
circuit_table.configure(request)
|
|
88
|
-
assignements_table = tables.
|
|
88
|
+
assignements_table = tables.ContractAssignementContractTable(instance.assignments.all())
|
|
89
89
|
assignements_table.configure(request)
|
|
90
90
|
|
|
91
91
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: netbox-contract
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
4
4
|
Summary: Contract management plugin for Netbox
|
|
5
5
|
Author-email: Marc Lebreuil <marc@famillelebreuil.net>
|
|
6
6
|
Project-URL: Homepage, https://github.com/mlebreuil/netbox-contract
|
|
@@ -78,3 +78,17 @@ FIELD_CHOICES = {
|
|
|
78
78
|
(venv) $ cd /opt/netbox/netbox/
|
|
79
79
|
(venv) $ python3 manage.py migrate
|
|
80
80
|
```
|
|
81
|
+
|
|
82
|
+
## release notes
|
|
83
|
+
|
|
84
|
+
### version 2.0.0
|
|
85
|
+
|
|
86
|
+
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.
|
|
87
|
+
|
|
88
|
+
#### version 2.0.1
|
|
89
|
+
|
|
90
|
+
Add support contract assignement panel to devices.
|
|
91
|
+
|
|
92
|
+
#### version 2.0.2
|
|
93
|
+
|
|
94
|
+
Add support for Netbox 3.5 whcih become the minimum version supported to accoodate the removal of NetBoxModelCSVForm class (replaced by NetBoxModelImportForm) .
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0001_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract/migrations/0007_invoice_date.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox-contract-2.0.0 → netbox-contract-2.0.2}/src/netbox_contract.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|