netbox-contract 2.4.3__tar.gz → 2.4.4__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.4.3/netbox_contract.egg-info → netbox_contract-2.4.4}/PKG-INFO +13 -2
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/README.md +11 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/__init__.py +10 -1
- netbox_contract-2.4.4/netbox_contract/constants.py +36 -0
- netbox_contract-2.4.4/netbox_contract/template_content.py +32 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4/netbox_contract.egg-info}/PKG-INFO +13 -2
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/pyproject.toml +2 -2
- netbox_contract-2.4.3/netbox_contract/constants.py +0 -21
- netbox_contract-2.4.3/netbox_contract/template_content.py +0 -185
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/CONTRIBUTING.md +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/LICENSE +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/MANIFEST.in +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/docs/img/accounting_dimensions.png +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/docs/img/contract.png +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/docs/img/contract_linked_objects.png +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/docs/img/invoice.png +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/docs/img/invoice_line.png +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/docs/img/invoice_linked_objects.png +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/api/__init__.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/api/serializers.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/api/urls.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/api/views.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/filtersets.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/forms.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/locale/en/LC_MESSAGES/django.mo +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/locale/en/LC_MESSAGES/django.po +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/locale/fr/LC_MESSAGES/django.mo +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/locale/fr/LC_MESSAGES/django.po +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0001_initial.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0002_alter_contract_circuit_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0003_alter_contract_custom_field_data_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0004_contract_currency_invoice_currency.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0005_contract_accounting_dimensions_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0006_alter_contract_circuit.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0007_invoice_date.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0008_invoice_comments.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0009_contract_external_reference.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0010_invoice_contracts.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0011_auto_20230122_2112.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0012_remove_invoice_contract.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0013_contract_documents_invoice_documents.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0014_contract_end_date.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0015_contractassignement.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0016_contract_parent.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0017_alter_contract_accounting_dimensions.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0018_contract_external_partie_object_id_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0019_auto_20230924_1813.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0020_alter_contract_external_partie.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0021_alter_contract_external_partie.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0022_alter_contract_internal_partie_alter_contract_parent.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0023_rename_contractassignement_contractassignment_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0024_remove_contract_external_partie.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0025_remove_contract_circuit_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0026_auto_20240421_1550.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0027_invoiceline.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0028_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0029_remove_invoiceline_accounting_dimensions_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0030_alter_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0031_contract_invoice_template_invoice_template.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0032_alter_invoice_period_end_alter_invoice_period_start_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0033_remove_contract_invoice_template.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0034_contract_yrc_alter_contract_mrc.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0035_accountingdimension_status_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0036_alter_invoiceline_accounting_dimensions.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0037_contract_notice_period_alter_contract_currency_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0038_alter_accountingdimension_options_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0039_alter_accountingdimension_status_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0040_alter_contract_currency_alter_invoice_currency_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0041_contracttype_contract_contract_type.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0042_remove_contract_netbox_cont_externa_6343fb_idx_and_more.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0043_invoice_status.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/__init__.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/models.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/navigation.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/search.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/tables.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/templates/contract_assignments_bottom.html +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/templates/contract_list_bottom.html +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/templates/netbox_contract/accountingdimension.html +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/templates/netbox_contract/contract.html +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/templates/netbox_contract/contractassignment.html +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/templates/netbox_contract/contracttype.html +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/templates/netbox_contract/invoice.html +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/templates/netbox_contract/invoiceline.html +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/templates/netbox_contract/serviceprovider.html +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/urls.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/views.py +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract.egg-info/SOURCES.txt +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract.egg-info/dependency_links.txt +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract.egg-info/requires.txt +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract.egg-info/top_level.txt +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/setup.cfg +0 -0
- {netbox_contract-2.4.3 → netbox_contract-2.4.4}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: netbox-contract
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.4
|
|
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
|
|
@@ -8,7 +8,7 @@ Project-URL: Bug Tracker, https://github.com/mlebreuil/netbox-contract/issues
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: python-dateutil
|
|
@@ -90,6 +90,17 @@ PLUGINS_CONFIG = {
|
|
|
90
90
|
'mandatory_invoice_fields': [],
|
|
91
91
|
'hidden_invoice_fields': [],
|
|
92
92
|
'mandatory_dimensions': [],
|
|
93
|
+
'supported_models': [
|
|
94
|
+
'circuits.circuit',
|
|
95
|
+
'circuits.virtualcircuit',
|
|
96
|
+
'dcim.site',
|
|
97
|
+
'dcim.device',
|
|
98
|
+
'dcim.rack',
|
|
99
|
+
'virtualization.virtualmachine',
|
|
100
|
+
'virtualization.cluster',
|
|
101
|
+
'ipam.ipaddress',
|
|
102
|
+
'ipam.prefix',
|
|
103
|
+
],
|
|
93
104
|
}
|
|
94
105
|
}
|
|
95
106
|
|
|
@@ -63,6 +63,17 @@ PLUGINS_CONFIG = {
|
|
|
63
63
|
'mandatory_invoice_fields': [],
|
|
64
64
|
'hidden_invoice_fields': [],
|
|
65
65
|
'mandatory_dimensions': [],
|
|
66
|
+
'supported_models': [
|
|
67
|
+
'circuits.circuit',
|
|
68
|
+
'circuits.virtualcircuit',
|
|
69
|
+
'dcim.site',
|
|
70
|
+
'dcim.device',
|
|
71
|
+
'dcim.rack',
|
|
72
|
+
'virtualization.virtualmachine',
|
|
73
|
+
'virtualization.cluster',
|
|
74
|
+
'ipam.ipaddress',
|
|
75
|
+
'ipam.prefix',
|
|
76
|
+
],
|
|
66
77
|
}
|
|
67
78
|
}
|
|
68
79
|
|
|
@@ -5,7 +5,7 @@ class ContractsConfig(PluginConfig):
|
|
|
5
5
|
name = 'netbox_contract'
|
|
6
6
|
verbose_name = 'Netbox contract'
|
|
7
7
|
description = 'Contract management plugin for Netbox'
|
|
8
|
-
version = '2.4.
|
|
8
|
+
version = '2.4.4'
|
|
9
9
|
author = 'Marc Lebreuil'
|
|
10
10
|
author_email = 'marc@famillelebreuil.net'
|
|
11
11
|
base_url = 'contracts'
|
|
@@ -18,6 +18,15 @@ class ContractsConfig(PluginConfig):
|
|
|
18
18
|
'mandatory_invoice_fields': [],
|
|
19
19
|
'hidden_invoice_fields': [],
|
|
20
20
|
'mandatory_dimensions': [],
|
|
21
|
+
'supported_models': [
|
|
22
|
+
'circuits.circuit',
|
|
23
|
+
'circuits.virtualcircuit',
|
|
24
|
+
'dcim.site',
|
|
25
|
+
'dcim.device',
|
|
26
|
+
'dcim.rack',
|
|
27
|
+
'virtualization.virtualmachine',
|
|
28
|
+
'virtualization.cluster',
|
|
29
|
+
],
|
|
21
30
|
}
|
|
22
31
|
|
|
23
32
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from django.db.models import Q
|
|
2
|
+
from django.conf import settings
|
|
3
|
+
|
|
4
|
+
plugin_settings = settings.PLUGINS_CONFIG['netbox_contract']
|
|
5
|
+
|
|
6
|
+
ASSIGNEMENT_TYPES = plugin_settings.get('supported_models')
|
|
7
|
+
|
|
8
|
+
SERVICE_PROVIDER_TYPES = (
|
|
9
|
+
'circuits.provider',
|
|
10
|
+
'netbox_contract.serviceprovider',
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
# ASSIGNEMENT_TYPES = (
|
|
14
|
+
# 'circuits.circuit',
|
|
15
|
+
# 'circuits.virtualcircuit',
|
|
16
|
+
# 'dcim.site',
|
|
17
|
+
# 'dcim.device',
|
|
18
|
+
# 'dcim.rack',
|
|
19
|
+
# 'virtualization.virtualmachine',
|
|
20
|
+
# 'virtualization.cluster',
|
|
21
|
+
# 'ipam.ipaddress',
|
|
22
|
+
# 'ipam.prefix',
|
|
23
|
+
# )
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def build_models_q(model_strings):
|
|
27
|
+
"""Build a Q object from a list of 'app_label.model' strings."""
|
|
28
|
+
q = Q()
|
|
29
|
+
for model_string in model_strings:
|
|
30
|
+
app_label, model = model_string.split('.')
|
|
31
|
+
q |= Q(app_label=app_label, model=model)
|
|
32
|
+
return q
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
ASSIGNEMENT_MODELS = build_models_q(ASSIGNEMENT_TYPES)
|
|
36
|
+
SERVICE_PROVIDER_MODELS = build_models_q(SERVICE_PROVIDER_TYPES)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from django.contrib.contenttypes.models import ContentType
|
|
2
|
+
from netbox.plugins import PluginTemplateExtension
|
|
3
|
+
|
|
4
|
+
from . import tables
|
|
5
|
+
from .models import ContractAssignment
|
|
6
|
+
from .constants import ASSIGNEMENT_TYPES
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ObjectContractAssignments(PluginTemplateExtension):
|
|
10
|
+
models = ASSIGNEMENT_TYPES
|
|
11
|
+
|
|
12
|
+
def full_width_page(self):
|
|
13
|
+
object = self.context['object']
|
|
14
|
+
object_type = ContentType.objects.get_for_model(object)
|
|
15
|
+
|
|
16
|
+
contract_assignments = ContractAssignment.objects.filter(
|
|
17
|
+
content_type__pk=object_type.id, object_id=object.id
|
|
18
|
+
)
|
|
19
|
+
assignments_table = tables.ContractAssignmentObjectTable(contract_assignments)
|
|
20
|
+
assignments_table.configure(self.context['request'])
|
|
21
|
+
|
|
22
|
+
return self.render(
|
|
23
|
+
'contract_assignments_bottom.html',
|
|
24
|
+
extra_context={
|
|
25
|
+
'assignments_table': assignments_table,
|
|
26
|
+
},
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
template_extensions = [
|
|
31
|
+
ObjectContractAssignments,
|
|
32
|
+
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: netbox-contract
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.4
|
|
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
|
|
@@ -8,7 +8,7 @@ Project-URL: Bug Tracker, https://github.com/mlebreuil/netbox-contract/issues
|
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
Requires-Dist: python-dateutil
|
|
@@ -90,6 +90,17 @@ PLUGINS_CONFIG = {
|
|
|
90
90
|
'mandatory_invoice_fields': [],
|
|
91
91
|
'hidden_invoice_fields': [],
|
|
92
92
|
'mandatory_dimensions': [],
|
|
93
|
+
'supported_models': [
|
|
94
|
+
'circuits.circuit',
|
|
95
|
+
'circuits.virtualcircuit',
|
|
96
|
+
'dcim.site',
|
|
97
|
+
'dcim.device',
|
|
98
|
+
'dcim.rack',
|
|
99
|
+
'virtualization.virtualmachine',
|
|
100
|
+
'virtualization.cluster',
|
|
101
|
+
'ipam.ipaddress',
|
|
102
|
+
'ipam.prefix',
|
|
103
|
+
],
|
|
93
104
|
}
|
|
94
105
|
}
|
|
95
106
|
|
|
@@ -7,14 +7,14 @@ build-backend = "setuptools.build_meta"
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "netbox-contract"
|
|
10
|
-
version = "2.4.
|
|
10
|
+
version = "2.4.4"
|
|
11
11
|
authors = [
|
|
12
12
|
{ name="Marc Lebreuil", email="marc@famillelebreuil.net" },
|
|
13
13
|
]
|
|
14
14
|
|
|
15
15
|
description = "Contract management plugin for Netbox"
|
|
16
16
|
readme = "README.md"
|
|
17
|
-
requires-python = ">=3.
|
|
17
|
+
requires-python = ">=3.12"
|
|
18
18
|
|
|
19
19
|
dependencies = [
|
|
20
20
|
'python-dateutil',
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from django.db.models import Q
|
|
2
|
-
|
|
3
|
-
SERVICE_PROVIDER_MODELS = Q(
|
|
4
|
-
Q(app_label='circuits', model__in=('provider',))
|
|
5
|
-
| Q(app_label='netbox_contract', model__in=('serviceprovider',))
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
SERVICE_PROVIDER_TYPES = (
|
|
9
|
-
'provider',
|
|
10
|
-
'serviceprovider',
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
ASSIGNEMENT_MODELS = Q(
|
|
14
|
-
Q(app_label='circuits', model__in=('circuit',))
|
|
15
|
-
| Q(app_label='circuits', model__in=('virtualcircuit',))
|
|
16
|
-
| Q(app_label='dcim', model__in=('site',))
|
|
17
|
-
| Q(app_label='dcim', model__in=('device',))
|
|
18
|
-
| Q(app_label='dcim', model__in=('rack',))
|
|
19
|
-
| Q(app_label='virtualization', model__in=('virtualmachine',))
|
|
20
|
-
| Q(app_label='virtualization', model__in=('cluster',))
|
|
21
|
-
)
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
from circuits.models import Circuit, VirtualCircuit, Provider
|
|
2
|
-
from dcim.models import Device, Site, Rack
|
|
3
|
-
from django.contrib.contenttypes.models import ContentType
|
|
4
|
-
from netbox.plugins import PluginTemplateExtension
|
|
5
|
-
from virtualization.models import VirtualMachine, Cluster
|
|
6
|
-
|
|
7
|
-
from . import tables
|
|
8
|
-
from .models import ContractAssignment, Contract
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class CircuitContractAssignments(PluginTemplateExtension):
|
|
12
|
-
models = ['circuits.circuit']
|
|
13
|
-
|
|
14
|
-
def full_width_page(self):
|
|
15
|
-
circuit = self.context['object']
|
|
16
|
-
circuit_type = ContentType.objects.get_for_model(Circuit)
|
|
17
|
-
contract_assignments = ContractAssignment.objects.filter(
|
|
18
|
-
content_type__pk=circuit_type.id, object_id=circuit.id
|
|
19
|
-
)
|
|
20
|
-
assignments_table = tables.ContractAssignmentObjectTable(contract_assignments)
|
|
21
|
-
assignments_table.configure(self.context['request'])
|
|
22
|
-
|
|
23
|
-
return self.render(
|
|
24
|
-
'contract_assignments_bottom.html',
|
|
25
|
-
extra_context={
|
|
26
|
-
'assignments_table': assignments_table,
|
|
27
|
-
},
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
class VirtualCircuitContractAssignments(PluginTemplateExtension):
|
|
32
|
-
models = ['circuits.virtualcircuit']
|
|
33
|
-
|
|
34
|
-
def full_width_page(self):
|
|
35
|
-
virtualcircuit = self.context['object']
|
|
36
|
-
virtualcircuit_type = ContentType.objects.get_for_model(VirtualCircuit)
|
|
37
|
-
contract_assignments = ContractAssignment.objects.filter(
|
|
38
|
-
content_type__pk=virtualcircuit_type.id, object_id=virtualcircuit.id
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
assignments_table = tables.ContractAssignmentObjectTable(contract_assignments)
|
|
42
|
-
assignments_table.configure(self.context['request'])
|
|
43
|
-
|
|
44
|
-
return self.render(
|
|
45
|
-
'contract_assignments_bottom.html',
|
|
46
|
-
extra_context={
|
|
47
|
-
'assignments_table': assignments_table,
|
|
48
|
-
},
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
class ProviderContracts(PluginTemplateExtension):
|
|
53
|
-
models = ['circuits.provider']
|
|
54
|
-
|
|
55
|
-
def full_width_page(self):
|
|
56
|
-
provider = self.context['object']
|
|
57
|
-
provider_type = ContentType.objects.get_for_model(Provider)
|
|
58
|
-
contracts = Contract.objects.filter(
|
|
59
|
-
external_party_object_type__pk=provider_type.id,
|
|
60
|
-
external_party_object_id=provider.id
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
contracts_table = tables.ContractProviderBottomTable(contracts)
|
|
64
|
-
contracts_table.configure(self.context['request'])
|
|
65
|
-
|
|
66
|
-
return self.render(
|
|
67
|
-
'contract_list_bottom.html',
|
|
68
|
-
extra_context={
|
|
69
|
-
'contracts_table': contracts_table,
|
|
70
|
-
},
|
|
71
|
-
)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
class DeviceContractAssignments(PluginTemplateExtension):
|
|
75
|
-
models = ['dcim.device']
|
|
76
|
-
|
|
77
|
-
def full_width_page(self):
|
|
78
|
-
device = self.context['object']
|
|
79
|
-
device_type = ContentType.objects.get_for_model(Device)
|
|
80
|
-
contract_assignments = ContractAssignment.objects.filter(
|
|
81
|
-
content_type__pk=device_type.id, object_id=device.id
|
|
82
|
-
)
|
|
83
|
-
assignments_table = tables.ContractAssignmentObjectTable(contract_assignments)
|
|
84
|
-
assignments_table.configure(self.context['request'])
|
|
85
|
-
|
|
86
|
-
return self.render(
|
|
87
|
-
'contract_assignments_bottom.html',
|
|
88
|
-
extra_context={
|
|
89
|
-
'assignments_table': assignments_table,
|
|
90
|
-
},
|
|
91
|
-
)
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
class SiteContractAssignments(PluginTemplateExtension):
|
|
95
|
-
models = ['dcim.site']
|
|
96
|
-
|
|
97
|
-
def full_width_page(self):
|
|
98
|
-
site = self.context['object']
|
|
99
|
-
site_type = ContentType.objects.get_for_model(Site)
|
|
100
|
-
contract_assignments = ContractAssignment.objects.filter(
|
|
101
|
-
content_type__pk=site_type.id, object_id=site.id
|
|
102
|
-
)
|
|
103
|
-
assignments_table = tables.ContractAssignmentObjectTable(contract_assignments)
|
|
104
|
-
assignments_table.configure(self.context['request'])
|
|
105
|
-
|
|
106
|
-
return self.render(
|
|
107
|
-
'contract_assignments_bottom.html',
|
|
108
|
-
extra_context={
|
|
109
|
-
'assignments_table': assignments_table,
|
|
110
|
-
},
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
class RackContractAssignments(PluginTemplateExtension):
|
|
115
|
-
models = ['dcim.rack']
|
|
116
|
-
|
|
117
|
-
def full_width_page(self):
|
|
118
|
-
rack = self.context['object']
|
|
119
|
-
rack_type = ContentType.objects.get_for_model(Rack)
|
|
120
|
-
contract_assignments = ContractAssignment.objects.filter(
|
|
121
|
-
content_type__pk=rack_type.id, object_id=rack.id
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
assignments_table = tables.ContractAssignmentObjectTable(contract_assignments)
|
|
125
|
-
assignments_table.configure(self.context['request'])
|
|
126
|
-
|
|
127
|
-
return self.render(
|
|
128
|
-
'contract_assignments_bottom.html',
|
|
129
|
-
extra_context={
|
|
130
|
-
'assignments_table': assignments_table,
|
|
131
|
-
},
|
|
132
|
-
)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
class VMContractAssignments(PluginTemplateExtension):
|
|
136
|
-
models = ['virtualization.virtualmachine']
|
|
137
|
-
|
|
138
|
-
def full_width_page(self):
|
|
139
|
-
vm = self.context['object']
|
|
140
|
-
vm_type = ContentType.objects.get_for_model(VirtualMachine)
|
|
141
|
-
contract_assignments = ContractAssignment.objects.filter(
|
|
142
|
-
content_type__pk=vm_type.id, object_id=vm.id
|
|
143
|
-
)
|
|
144
|
-
assignments_table = tables.ContractAssignmentObjectTable(contract_assignments)
|
|
145
|
-
assignments_table.configure(self.context['request'])
|
|
146
|
-
|
|
147
|
-
return self.render(
|
|
148
|
-
'contract_assignments_bottom.html',
|
|
149
|
-
extra_context={
|
|
150
|
-
'assignments_table': assignments_table,
|
|
151
|
-
},
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
class ClusterContractAssignments(PluginTemplateExtension):
|
|
156
|
-
models = ['virtualization.cluster']
|
|
157
|
-
|
|
158
|
-
def full_width_page(self):
|
|
159
|
-
cluster = self.context['object']
|
|
160
|
-
cluster_type = ContentType.objects.get_for_model(Cluster)
|
|
161
|
-
contract_assignments = ContractAssignment.objects.filter(
|
|
162
|
-
content_type__pk=cluster_type.id, object_id=cluster.id
|
|
163
|
-
)
|
|
164
|
-
|
|
165
|
-
assignments_table = tables.ContractAssignmentObjectTable(contract_assignments)
|
|
166
|
-
assignments_table.configure(self.context['request'])
|
|
167
|
-
|
|
168
|
-
return self.render(
|
|
169
|
-
'contract_assignments_bottom.html',
|
|
170
|
-
extra_context={
|
|
171
|
-
'assignments_table': assignments_table,
|
|
172
|
-
},
|
|
173
|
-
)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
template_extensions = [
|
|
177
|
-
CircuitContractAssignments,
|
|
178
|
-
VirtualCircuitContractAssignments,
|
|
179
|
-
ProviderContracts,
|
|
180
|
-
DeviceContractAssignments,
|
|
181
|
-
SiteContractAssignments,
|
|
182
|
-
RackContractAssignments,
|
|
183
|
-
VMContractAssignments,
|
|
184
|
-
ClusterContractAssignments,
|
|
185
|
-
]
|
|
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.4.3 → netbox_contract-2.4.4}/netbox_contract/locale/en/LC_MESSAGES/django.mo
RENAMED
|
File without changes
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/locale/en/LC_MESSAGES/django.po
RENAMED
|
File without changes
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/locale/fr/LC_MESSAGES/django.mo
RENAMED
|
File without changes
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/locale/fr/LC_MESSAGES/django.po
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0007_invoice_date.py
RENAMED
|
File without changes
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0008_invoice_comments.py
RENAMED
|
File without changes
|
|
File without changes
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0010_invoice_contracts.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0014_contract_end_date.py
RENAMED
|
File without changes
|
|
File without changes
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0016_contract_parent.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
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0027_invoiceline.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
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/migrations/0043_invoice_status.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract/templates/contract_list_bottom.html
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
|
{netbox_contract-2.4.3 → netbox_contract-2.4.4}/netbox_contract.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|