prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add support for an OS Model to define target OS image per device
  ### Proposed Functionality
  Support a model to define OSs that should be used by each device and ensure there is also a relationship between vendor and platform.
  
  ### Use Case
  As a user, I should be able to define the intended OS or list of supported OSs per device. I should preferably be able to run search queries within the UI using greater than and less than (<>) operators to verify if my devices.
  
  ### Database Changes
  Yes, will require a new database model(s), as well as updates to Vendor and Platform models
  
  ### External Dependencies
  Maybe - need to explore external library(ies) for parsing idiosyncratic vendor OS version strings.
  
  
  </issue>
  <code>
  [start of nautobot/dcim/api/urls.py]
  1 from nautobot.core.api.routers import OrderedDefaultRouter
  2 
  3 from . import views
  4 
  5 router = OrderedDefaultRouter()
  6 router.APIRootView = views.DCIMRootView
  7 
  8 # Locations
  9 router.register("location-types", views.LocationTypeViewSet)
  10 router.register("locations", views.LocationViewSet)
  11 
  12 # Racks
  13 router.register("rack-groups", views.RackGroupViewSet)
  14 router.register("racks", views.RackViewSet)
  15 router.register("rack-reservations", views.RackReservationViewSet)
  16 
  17 # Device types
  18 router.register("hardware-families", views.HardwareFamilyViewSet)
  19 router.register("manufacturers", views.ManufacturerViewSet)
  20 router.register("device-types", views.DeviceTypeViewSet)
  21 
  22 # Device type components
  23 router.register("console-port-templates", views.ConsolePortTemplateViewSet)
  24 router.register("console-server-port-templates", views.ConsoleServerPortTemplateViewSet)
  25 router.register("power-port-templates", views.PowerPortTemplateViewSet)
  26 router.register("power-outlet-templates", views.PowerOutletTemplateViewSet)
  27 router.register("interface-templates", views.InterfaceTemplateViewSet)
  28 router.register("front-port-templates", views.FrontPortTemplateViewSet)
  29 router.register("rear-port-templates", views.RearPortTemplateViewSet)
  30 router.register("device-bay-templates", views.DeviceBayTemplateViewSet)
  31 
  32 # Devices
  33 router.register("platforms", views.PlatformViewSet)
  34 router.register("devices", views.DeviceViewSet)
  35 
  36 # Device components
  37 router.register("console-ports", views.ConsolePortViewSet)
  38 router.register("console-server-ports", views.ConsoleServerPortViewSet)
  39 router.register("power-ports", views.PowerPortViewSet)
  40 router.register("power-outlets", views.PowerOutletViewSet)
  41 router.register("interfaces", views.InterfaceViewSet)
  42 router.register("front-ports", views.FrontPortViewSet)
  43 router.register("rear-ports", views.RearPortViewSet)
  44 router.register("device-bays", views.DeviceBayViewSet)
  45 router.register("inventory-items", views.InventoryItemViewSet)
  46 
  47 # Connections
  48 router.register("console-connections", views.ConsoleConnectionViewSet, basename="consoleconnections")
  49 router.register("power-connections", views.PowerConnectionViewSet, basename="powerconnections")
  50 router.register(
  51     "interface-connections",
  52     views.InterfaceConnectionViewSet,
  53     basename="interfaceconnections",
  54 )
  55 
  56 # Cables
  57 router.register("cables", views.CableViewSet)
  58 
  59 # Interface Redundancy Group
  60 router.register("interface-redundancy-groups", views.InterfaceRedundancyGroupViewSet)
  61 router.register("interface-redundancy-group-associations", views.InterfaceRedundancyGroupAssociationViewSet)
  62 
  63 # Virtual chassis
  64 router.register("virtual-chassis", views.VirtualChassisViewSet)
  65 
  66 # Power
  67 router.register("power-panels", views.PowerPanelViewSet)
  68 router.register("power-feeds", views.PowerFeedViewSet)
  69 
  70 # Device Redundancy Group
  71 router.register("device-redundancy-groups", views.DeviceRedundancyGroupViewSet)
  72 
  73 # Software images
  74 router.register("software-images", views.SoftwareImageViewSet)
  75 router.register("software-versions", views.SoftwareVersionViewSet)
  76 router.register("device-type-to-software-image", views.DeviceTypeToSoftwareImageViewSet)
  77 
  78 # Miscellaneous
  79 router.register("connected-device", views.ConnectedDeviceViewSet, basename="connected-device")
  80 
  81 app_name = "dcim-api"
  82 urlpatterns = router.urls
  83
  [end of nautobot/dcim/api/urls.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/nautobot/dcim/api/urls.py b/nautobot/dcim/api/urls.py
  --- a/nautobot/dcim/api/urls.py
  +++ b/nautobot/dcim/api/urls.py
  @@ -73,7 +73,7 @@
   # Software images
   router.register("software-images", views.SoftwareImageViewSet)
   router.register("software-versions", views.SoftwareVersionViewSet)
  -router.register("device-type-to-software-image", views.DeviceTypeToSoftwareImageViewSet)
  +router.register("device-types-to-software-images", views.DeviceTypeToSoftwareImageViewSet)
   
   # Miscellaneous
   router.register("connected-device", views.ConnectedDeviceViewSet, basename="connected-device")
  
verification_info: {"golden_diff": "diff --git a/nautobot/dcim/api/urls.py b/nautobot/dcim/api/urls.py\n--- a/nautobot/dcim/api/urls.py\n+++ b/nautobot/dcim/api/urls.py\n@@ -73,7 +73,7 @@\n # Software images\n router.register(\"software-images\", views.SoftwareImageViewSet)\n router.register(\"software-versions\", views.SoftwareVersionViewSet)\n-router.register(\"device-type-to-software-image\", views.DeviceTypeToSoftwareImageViewSet)\n+router.register(\"device-types-to-software-images\", views.DeviceTypeToSoftwareImageViewSet)\n \n # Miscellaneous\n router.register(\"connected-device\", views.ConnectedDeviceViewSet, basename=\"connected-device\")\n", "issue": "Add support for an OS Model to define target OS image per device\n### Proposed Functionality\r\nSupport a model to define OSs that should be used by each device and ensure there is also a relationship between vendor and platform.\r\n\r\n### Use Case\r\nAs a user, I should be able to define the intended OS or list of supported OSs per device. I should preferably be able to run search queries within the UI using greater than and less than (<>) operators to verify if my devices.\r\n\r\n### Database Changes\r\nYes, will require a new database model(s), as well as updates to Vendor and Platform models\r\n\r\n### External Dependencies\r\nMaybe - need to explore external library(ies) for parsing idiosyncratic vendor OS version strings.\r\n\n", "before_files": [{"content": "from nautobot.core.api.routers import OrderedDefaultRouter\n\nfrom . import views\n\nrouter = OrderedDefaultRouter()\nrouter.APIRootView = views.DCIMRootView\n\n# Locations\nrouter.register(\"location-types\", views.LocationTypeViewSet)\nrouter.register(\"locations\", views.LocationViewSet)\n\n# Racks\nrouter.register(\"rack-groups\", views.RackGroupViewSet)\nrouter.register(\"racks\", views.RackViewSet)\nrouter.register(\"rack-reservations\", views.RackReservationViewSet)\n\n# Device types\nrouter.register(\"hardware-families\", views.HardwareFamilyViewSet)\nrouter.register(\"manufacturers\", views.ManufacturerViewSet)\nrouter.register(\"device-types\", views.DeviceTypeViewSet)\n\n# Device type components\nrouter.register(\"console-port-templates\", views.ConsolePortTemplateViewSet)\nrouter.register(\"console-server-port-templates\", views.ConsoleServerPortTemplateViewSet)\nrouter.register(\"power-port-templates\", views.PowerPortTemplateViewSet)\nrouter.register(\"power-outlet-templates\", views.PowerOutletTemplateViewSet)\nrouter.register(\"interface-templates\", views.InterfaceTemplateViewSet)\nrouter.register(\"front-port-templates\", views.FrontPortTemplateViewSet)\nrouter.register(\"rear-port-templates\", views.RearPortTemplateViewSet)\nrouter.register(\"device-bay-templates\", views.DeviceBayTemplateViewSet)\n\n# Devices\nrouter.register(\"platforms\", views.PlatformViewSet)\nrouter.register(\"devices\", views.DeviceViewSet)\n\n# Device components\nrouter.register(\"console-ports\", views.ConsolePortViewSet)\nrouter.register(\"console-server-ports\", views.ConsoleServerPortViewSet)\nrouter.register(\"power-ports\", views.PowerPortViewSet)\nrouter.register(\"power-outlets\", views.PowerOutletViewSet)\nrouter.register(\"interfaces\", views.InterfaceViewSet)\nrouter.register(\"front-ports\", views.FrontPortViewSet)\nrouter.register(\"rear-ports\", views.RearPortViewSet)\nrouter.register(\"device-bays\", views.DeviceBayViewSet)\nrouter.register(\"inventory-items\", views.InventoryItemViewSet)\n\n# Connections\nrouter.register(\"console-connections\", views.ConsoleConnectionViewSet, basename=\"consoleconnections\")\nrouter.register(\"power-connections\", views.PowerConnectionViewSet, basename=\"powerconnections\")\nrouter.register(\n    \"interface-connections\",\n    views.InterfaceConnectionViewSet,\n    basename=\"interfaceconnections\",\n)\n\n# Cables\nrouter.register(\"cables\", views.CableViewSet)\n\n# Interface Redundancy Group\nrouter.register(\"interface-redundancy-groups\", views.InterfaceRedundancyGroupViewSet)\nrouter.register(\"interface-redundancy-group-associations\", views.InterfaceRedundancyGroupAssociationViewSet)\n\n# Virtual chassis\nrouter.register(\"virtual-chassis\", views.VirtualChassisViewSet)\n\n# Power\nrouter.register(\"power-panels\", views.PowerPanelViewSet)\nrouter.register(\"power-feeds\", views.PowerFeedViewSet)\n\n# Device Redundancy Group\nrouter.register(\"device-redundancy-groups\", views.DeviceRedundancyGroupViewSet)\n\n# Software images\nrouter.register(\"software-images\", views.SoftwareImageViewSet)\nrouter.register(\"software-versions\", views.SoftwareVersionViewSet)\nrouter.register(\"device-type-to-software-image\", views.DeviceTypeToSoftwareImageViewSet)\n\n# Miscellaneous\nrouter.register(\"connected-device\", views.ConnectedDeviceViewSet, basename=\"connected-device\")\n\napp_name = \"dcim-api\"\nurlpatterns = router.urls\n", "path": "nautobot/dcim/api/urls.py"}]}