Skip to content

Commit

Permalink
Merge pull request #194 from netbox-community/bug/193-tenant-filtering
Browse files Browse the repository at this point in the history
Fixes: #180 - add TenancyFilterset to Tenant filtered models
  • Loading branch information
cruse1977 authored May 17, 2024
2 parents 6dfb25f + 3b0b5fb commit dc2f675
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This plugin provide following Models:
| NetBox 3.5 | >= 0.10.0 |
| NetBox 3.6 | >= 0.11.0 |
| NetBox 3.7 | >= 0.12.0 |
| NetBox 4.0 | >= 0.13.0 |
| NetBox 4.0 | >= 0.13.2 |

## Installation

Expand Down
5 changes: 3 additions & 2 deletions netbox_bgp/filtersets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.db.models import Q
from netaddr.core import AddrFormatError
from netbox.filtersets import NetBoxModelFilterSet
from tenancy.filtersets import TenancyFilterSet

from .models import (
Community, BGPSession, RoutingPolicy, RoutingPolicyRule,
Expand All @@ -13,7 +14,7 @@
from dcim.models import Device, Site


class CommunityFilterSet(NetBoxModelFilterSet):
class CommunityFilterSet(NetBoxModelFilterSet, TenancyFilterSet):

class Meta:
model = Community
Expand Down Expand Up @@ -65,7 +66,7 @@ def search(self, queryset, name, value):
return queryset.filter(qs_filter)


class BGPSessionFilterSet(NetBoxModelFilterSet):
class BGPSessionFilterSet(NetBoxModelFilterSet, TenancyFilterSet):

remote_as = django_filters.ModelMultipleChoiceFilter(
field_name='remote_as__asn',
Expand Down
2 changes: 1 addition & 1 deletion netbox_bgp/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.13.1"
__version__ = "0.13.2"

0 comments on commit dc2f675

Please sign in to comment.