Skip to content

Commit c251728

Browse files
committed
add missing type hints for drf spectacular
1 parent eff67c8 commit c251728

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nautobot_firewall_models/filters.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class Meta:
253253
] + ["device", "virtual_machine"]
254254

255255
@staticmethod
256-
def filter_device(queryset, _, value):
256+
def filter_device(queryset, _, value: Device):
257257
"""Dedicated filter method for device form field (needed because of the use of ContentType)."""
258258
if not value:
259259
return queryset
@@ -263,7 +263,7 @@ def filter_device(queryset, _, value):
263263
return queryset.filter(content_type=content_type, object_id__in=[v.id for v in value])
264264

265265
@staticmethod
266-
def filter_virtual_machine(queryset, _, value):
266+
def filter_virtual_machine(queryset, _, value: VirtualMachine):
267267
"""Dedicated filter method for virtual_machine form field (needed because of the use of ContentType)."""
268268
if not value:
269269
return queryset
@@ -273,7 +273,7 @@ def filter_virtual_machine(queryset, _, value):
273273
return queryset.filter(content_type=content_type, object_id__in=[v.id for v in value])
274274

275275
@staticmethod
276-
def filter_q(queryset, _, value):
276+
def filter_q(queryset, _, value: str):
277277
"""Custom filter method for q for handling GenericForeignKey."""
278278
if not value:
279279
return queryset

0 commit comments

Comments
 (0)