-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from jasonyates/022
v0.2.2
- Loading branch information
Showing
12 changed files
with
114 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,18 @@ | ||
# Changelog | ||
|
||
## 0.2.2 (2023-01-18) | ||
|
||
* Fix API Filtersets | ||
* Viewing notification content opens a new tab | ||
* Updating RESCHEDULED to RE-SCHEDULED to match circuitparser | ||
|
||
## 0.2.1 (2023-01-17) | ||
|
||
* Updating to DynamicModelChoiceField | ||
* Hiding maintenance schedule for now | ||
|
||
## 0.1.0 (2023-01-15) | ||
|
||
* First release on PyPI. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
__author__ = """Jason Yates""" | ||
__email__ = '[email protected]' | ||
__version__ = '0.2.1' | ||
__version__ = '0.2.2' | ||
|
||
|
||
from extras.plugins import PluginConfig | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
from netbox.api.viewsets import NetBoxModelViewSet | ||
|
||
from .. import models | ||
from .. import models, filtersets | ||
from .serializers import CircuitMaintenanceSerializer, CircuitMaintenanceImpactSerializer, CircuitMaintenanceNotificationsSerializer | ||
|
||
class CircuitMaintenanceViewSet(NetBoxModelViewSet): | ||
queryset = models.CircuitMaintenance.objects.prefetch_related('tags') | ||
serializer_class = CircuitMaintenanceSerializer | ||
filterset_class = filtersets.CircuitMaintenanceFilterSet | ||
|
||
class CircuitMaintenanceImpactViewSet(NetBoxModelViewSet): | ||
queryset = models.CircuitMaintenanceImpact.objects.prefetch_related('tags') | ||
serializer_class = CircuitMaintenanceImpactSerializer | ||
filterset_class = filtersets.CircuitMaintenanceImpactFilterSet | ||
|
||
class CircuitMaintenanceNotificationsViewSet(NetBoxModelViewSet): | ||
queryset = models.CircuitMaintenanceNotifications.objects.prefetch_related('tags') | ||
serializer_class = CircuitMaintenanceNotificationsSerializer | ||
serializer_class = CircuitMaintenanceNotificationsSerializer | ||
filterset_class = filtersets.CircuitMaintenanceNotificationsFilterSet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,42 @@ | ||
from netbox.filtersets import NetBoxModelFilterSet | ||
from .models import CircuitMaintenance | ||
from .models import CircuitMaintenance, CircuitMaintenanceImpact, CircuitMaintenanceNotifications | ||
from django.db.models import Q | ||
|
||
class CircuitMaintenanceFilterSet(NetBoxModelFilterSet): | ||
|
||
# class circuitmaintenanceFilterSet(NetBoxModelFilterSet): | ||
# | ||
# class Meta: | ||
# model = circuitmaintenance | ||
# fields = ['name', ] | ||
# | ||
# def search(self, queryset, name, value): | ||
# return queryset.filter(description__icontains=value) | ||
class Meta: | ||
model = CircuitMaintenance | ||
fields = ('id', 'name', 'summary', 'status', 'provider', 'start', 'end', 'impact', 'internal_ticket', 'acknowledged', 'comments') | ||
|
||
def search(self, queryset, name, value): | ||
if not value.strip(): | ||
return queryset | ||
return queryset.filter( | ||
Q(name__icontains=value) | ||
) | ||
|
||
class CircuitMaintenanceImpactFilterSet(NetBoxModelFilterSet): | ||
|
||
class Meta: | ||
model = CircuitMaintenanceImpact | ||
fields = ('id', 'circuitmaintenance', 'circuit', 'impact') | ||
|
||
def search(self, queryset, name, value): | ||
if not value.strip(): | ||
return queryset | ||
return queryset.filter( | ||
Q(circuit__icontains=value) | ||
) | ||
|
||
class CircuitMaintenanceNotificationsFilterSet(NetBoxModelFilterSet): | ||
|
||
class Meta: | ||
model = CircuitMaintenanceNotifications | ||
fields = ('id', 'email_body', 'subject', 'email_from', 'email_recieved') | ||
|
||
def search(self, queryset, name, value): | ||
if not value.strip(): | ||
return queryset | ||
return queryset.filter( | ||
Q(subject__icontains=value) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "netbox-circuitmaintenance" | ||
version = "0.2.1" | ||
version = "0.2.2" | ||
description = "Provides the ability to record circuit maintenance, maintenance impact and maintenance notifications in Netbox and link them to Providers and Circuits." | ||
readme = "README.md" | ||
authors = [{ name = "Jason Yates", email = "[email protected]" }] | ||
|
@@ -19,7 +19,7 @@ Homepage = "https://github.com/jasonyates/netbox-circuitmaintenance" | |
dev = ["black", "bumpver", "isort", "pip-tools", "pytest"] | ||
|
||
[tool.bumpver] | ||
current_version = "0.2.1" | ||
current_version = "0.2.2" | ||
version_pattern = "MAJOR.MINOR.PATCH" | ||
commit_message = "bump version {old_version} -> {new_version}" | ||
commit = true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters