prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add Device Name Filter to Secrets API
  Filter secrets by the devices they're associated to.
  
  
  </issue>
  <code>
  [start of netbox/secrets/filters.py]
  1 import django_filters
  2 
  3 from .models import Secret, SecretRole
  4 
  5 
  6 class SecretFilter(django_filters.FilterSet):
  7     role_id = django_filters.ModelMultipleChoiceFilter(
  8         name='role',
  9         queryset=SecretRole.objects.all(),
  10         label='Role (ID)',
  11     )
  12     role = django_filters.ModelMultipleChoiceFilter(
  13         name='role',
  14         queryset=SecretRole.objects.all(),
  15         to_field_name='slug',
  16         label='Role (slug)',
  17     )
  18 
  19     class Meta:
  20         model = Secret
  21         fields = ['name', 'role_id', 'role']
  22
  [end of netbox/secrets/filters.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/netbox/secrets/filters.py b/netbox/secrets/filters.py
  --- a/netbox/secrets/filters.py
  +++ b/netbox/secrets/filters.py
  @@ -1,6 +1,7 @@
   import django_filters
   
   from .models import Secret, SecretRole
  +from dcim.models import Device
   
   
   class SecretFilter(django_filters.FilterSet):
  @@ -15,7 +16,13 @@
           to_field_name='slug',
           label='Role (slug)',
       )
  +    device = django_filters.ModelMultipleChoiceFilter(
  +        name='device',
  +        queryset=Device.objects.all(),
  +        to_field_name='name',
  +        label='Device (Name)',
  +    )
   
       class Meta:
           model = Secret
  -        fields = ['name', 'role_id', 'role']
  +        fields = ['name', 'role_id', 'role', 'device']
  
verification_info: {"golden_diff": "diff --git a/netbox/secrets/filters.py b/netbox/secrets/filters.py\n--- a/netbox/secrets/filters.py\n+++ b/netbox/secrets/filters.py\n@@ -1,6 +1,7 @@\n import django_filters\n \n from .models import Secret, SecretRole\n+from dcim.models import Device\n \n \n class SecretFilter(django_filters.FilterSet):\n@@ -15,7 +16,13 @@\n         to_field_name='slug',\n         label='Role (slug)',\n     )\n+    device = django_filters.ModelMultipleChoiceFilter(\n+        name='device',\n+        queryset=Device.objects.all(),\n+        to_field_name='name',\n+        label='Device (Name)',\n+    )\n \n     class Meta:\n         model = Secret\n-        fields = ['name', 'role_id', 'role']\n+        fields = ['name', 'role_id', 'role', 'device']\n", "issue": "Add Device Name Filter to Secrets API\nFilter secrets by the devices they're associated to.\n\n", "before_files": [{"content": "import django_filters\n\nfrom .models import Secret, SecretRole\n\n\nclass SecretFilter(django_filters.FilterSet):\n    role_id = django_filters.ModelMultipleChoiceFilter(\n        name='role',\n        queryset=SecretRole.objects.all(),\n        label='Role (ID)',\n    )\n    role = django_filters.ModelMultipleChoiceFilter(\n        name='role',\n        queryset=SecretRole.objects.all(),\n        to_field_name='slug',\n        label='Role (slug)',\n    )\n\n    class Meta:\n        model = Secret\n        fields = ['name', 'role_id', 'role']\n", "path": "netbox/secrets/filters.py"}]}