prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  1.2 Homepage object counts for DCIM all point to Rack model
  <!--
      NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED.
  
      This form is only for reporting reproducible bugs. If you need assistance
      with Nautobot installation, or if you have a general question, please start a
      discussion instead: https://github.com/nautobot/nautobot/discussions
  
      Please describe the environment in which you are running Nautobot. Be sure
      that you are running an unmodified instance of the latest stable release
      before submitting a bug report, and that any plugins have been disabled.
  -->
  ### Environment
  * Python version: 3.9
  * Nautobot version: 1.2.0-alpha1
  
  <!--
      Describe in detail the exact steps that someone else can take to reproduce
      this bug using the current stable release of Nautobot. Begin with the
      creation of any necessary database objects and call out every operation
      being performed explicitly. If reporting a bug in the REST API, be sure to
      reconstruct the raw HTTP request(s) being made: Don't rely on a client
      library such as pynautobot.
  -->
  ### Steps to Reproduce
  1. Create a set of each DCIM object which is listed on the homepage, like devices, interfaces, etc., and exactly 1 Rack
  2. Navigate to the home page
  
  <!-- What did you expect to happen? -->
  ### Expected Behavior
  The home page widgets for object counts for DCIM should list correct counts for each object type.
  
  <!-- What happened instead? -->
  ### Observed Behavior
  Other than sites, all other DCIM object counts show the number of racks (in this case, exactly 1).
  
  </issue>
  <code>
  [start of nautobot/dcim/homepage.py]
  1 from nautobot.dcim.models.power import PowerFeed, PowerPanel
  2 from nautobot.dcim.models import Cable, ConsolePort, Interface, PowerOutlet, Rack, Site
  3 from nautobot.core.apps import HomePageGroup, HomePageItem, HomePagePanel
  4 
  5 
  6 layout = (
  7     HomePagePanel(
  8         name="Organization",
  9         weight=100,
  10         items=(
  11             HomePageItem(
  12                 name="Sites",
  13                 link="dcim:site_list",
  14                 model=Site,
  15                 description="Geographic location",
  16                 permissions=["dcim.view_site"],
  17                 weight=100,
  18             ),
  19         ),
  20     ),
  21     HomePagePanel(
  22         name="DCIM",
  23         weight=200,
  24         items=(
  25             HomePageItem(
  26                 name="Racks",
  27                 link="dcim:rack_list",
  28                 model=Rack,
  29                 description="Equipment racks, optionally organized by group",
  30                 permissions=["dcim.view_rack"],
  31                 weight=100,
  32             ),
  33             HomePageItem(
  34                 name="Device Types",
  35                 link="dcim:devicetype_list",
  36                 model=Rack,
  37                 description="Physical hardware models by manufacturer",
  38                 permissions=["dcim.view_devicetype"],
  39                 weight=200,
  40             ),
  41             HomePageItem(
  42                 name="Devices",
  43                 link="dcim:device_list",
  44                 model=Rack,
  45                 description="Rack-mounted network equipment, servers, and other devices",
  46                 permissions=["dcim.view_device"],
  47                 weight=300,
  48             ),
  49             HomePageItem(
  50                 name="Virtual Chassis",
  51                 link="dcim:virtualchassis_list",
  52                 model=Rack,
  53                 permissions=["dcim.view_virtualchassis"],
  54                 description="Represents a set of devices which share a common control plane",
  55                 weight=400,
  56             ),
  57             HomePageGroup(
  58                 name="Connections",
  59                 weight=500,
  60                 items=(
  61                     HomePageItem(
  62                         name="Cables",
  63                         link="dcim:cable_list",
  64                         model=Cable,
  65                         permissions=["dcim.view_cable"],
  66                         weight=100,
  67                     ),
  68                     HomePageItem(
  69                         name="Interfaces",
  70                         link="dcim:interface_connections_list",
  71                         model=Interface,
  72                         permissions=["dcim.view_interface"],
  73                         weight=200,
  74                     ),
  75                     HomePageItem(
  76                         name="Console",
  77                         link="dcim:console_connections_list",
  78                         model=ConsolePort,
  79                         permissions=["dcim.view_consoleport", "dcim.view_consoleserverport"],
  80                         weight=300,
  81                     ),
  82                     HomePageItem(
  83                         name="Power",
  84                         link="dcim:power_connections_list",
  85                         model=PowerOutlet,
  86                         permissions=["dcim.view_powerport", "dcim.view_poweroutlet"],
  87                         weight=400,
  88                     ),
  89                 ),
  90             ),
  91         ),
  92     ),
  93     HomePagePanel(
  94         name="Power",
  95         weight=300,
  96         items=(
  97             HomePageItem(
  98                 name="Power Feeds",
  99                 link="dcim:powerfeed_list",
  100                 model=PowerFeed,
  101                 description="Electrical circuits delivering power from panels",
  102                 permissions=["dcim.view_powerfeed"],
  103                 weight=100,
  104             ),
  105             HomePageItem(
  106                 name="Power Panels",
  107                 link="dcim:powerpanel_list",
  108                 model=PowerPanel,
  109                 description="Electrical panels receiving utility power",
  110                 permissions=["dcim.view_powerpanel"],
  111                 weight=200,
  112             ),
  113         ),
  114     ),
  115 )
  116
  [end of nautobot/dcim/homepage.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/homepage.py b/nautobot/dcim/homepage.py
  --- a/nautobot/dcim/homepage.py
  +++ b/nautobot/dcim/homepage.py
  @@ -1,6 +1,5 @@
  -from nautobot.dcim.models.power import PowerFeed, PowerPanel
  -from nautobot.dcim.models import Cable, ConsolePort, Interface, PowerOutlet, Rack, Site
   from nautobot.core.apps import HomePageGroup, HomePageItem, HomePagePanel
  +from nautobot.dcim import models
   
   
   layout = (
  @@ -11,7 +10,7 @@
               HomePageItem(
                   name="Sites",
                   link="dcim:site_list",
  -                model=Site,
  +                model=models.Site,
                   description="Geographic location",
                   permissions=["dcim.view_site"],
                   weight=100,
  @@ -25,7 +24,7 @@
               HomePageItem(
                   name="Racks",
                   link="dcim:rack_list",
  -                model=Rack,
  +                model=models.Rack,
                   description="Equipment racks, optionally organized by group",
                   permissions=["dcim.view_rack"],
                   weight=100,
  @@ -33,7 +32,7 @@
               HomePageItem(
                   name="Device Types",
                   link="dcim:devicetype_list",
  -                model=Rack,
  +                model=models.DeviceType,
                   description="Physical hardware models by manufacturer",
                   permissions=["dcim.view_devicetype"],
                   weight=200,
  @@ -41,7 +40,7 @@
               HomePageItem(
                   name="Devices",
                   link="dcim:device_list",
  -                model=Rack,
  +                model=models.Device,
                   description="Rack-mounted network equipment, servers, and other devices",
                   permissions=["dcim.view_device"],
                   weight=300,
  @@ -49,7 +48,7 @@
               HomePageItem(
                   name="Virtual Chassis",
                   link="dcim:virtualchassis_list",
  -                model=Rack,
  +                model=models.VirtualChassis,
                   permissions=["dcim.view_virtualchassis"],
                   description="Represents a set of devices which share a common control plane",
                   weight=400,
  @@ -61,28 +60,28 @@
                       HomePageItem(
                           name="Cables",
                           link="dcim:cable_list",
  -                        model=Cable,
  +                        model=models.Cable,
                           permissions=["dcim.view_cable"],
                           weight=100,
                       ),
                       HomePageItem(
                           name="Interfaces",
                           link="dcim:interface_connections_list",
  -                        model=Interface,
  +                        model=models.Interface,
                           permissions=["dcim.view_interface"],
                           weight=200,
                       ),
                       HomePageItem(
                           name="Console",
                           link="dcim:console_connections_list",
  -                        model=ConsolePort,
  +                        model=models.ConsolePort,
                           permissions=["dcim.view_consoleport", "dcim.view_consoleserverport"],
                           weight=300,
                       ),
                       HomePageItem(
                           name="Power",
                           link="dcim:power_connections_list",
  -                        model=PowerOutlet,
  +                        model=models.PowerOutlet,
                           permissions=["dcim.view_powerport", "dcim.view_poweroutlet"],
                           weight=400,
                       ),
  @@ -97,7 +96,7 @@
               HomePageItem(
                   name="Power Feeds",
                   link="dcim:powerfeed_list",
  -                model=PowerFeed,
  +                model=models.PowerFeed,
                   description="Electrical circuits delivering power from panels",
                   permissions=["dcim.view_powerfeed"],
                   weight=100,
  @@ -105,7 +104,7 @@
               HomePageItem(
                   name="Power Panels",
                   link="dcim:powerpanel_list",
  -                model=PowerPanel,
  +                model=models.PowerPanel,
                   description="Electrical panels receiving utility power",
                   permissions=["dcim.view_powerpanel"],
                   weight=200,
  
verification_info: {"golden_diff": "diff --git a/nautobot/dcim/homepage.py b/nautobot/dcim/homepage.py\n--- a/nautobot/dcim/homepage.py\n+++ b/nautobot/dcim/homepage.py\n@@ -1,6 +1,5 @@\n-from nautobot.dcim.models.power import PowerFeed, PowerPanel\n-from nautobot.dcim.models import Cable, ConsolePort, Interface, PowerOutlet, Rack, Site\n from nautobot.core.apps import HomePageGroup, HomePageItem, HomePagePanel\n+from nautobot.dcim import models\n \n \n layout = (\n@@ -11,7 +10,7 @@\n             HomePageItem(\n                 name=\"Sites\",\n                 link=\"dcim:site_list\",\n-                model=Site,\n+                model=models.Site,\n                 description=\"Geographic location\",\n                 permissions=[\"dcim.view_site\"],\n                 weight=100,\n@@ -25,7 +24,7 @@\n             HomePageItem(\n                 name=\"Racks\",\n                 link=\"dcim:rack_list\",\n-                model=Rack,\n+                model=models.Rack,\n                 description=\"Equipment racks, optionally organized by group\",\n                 permissions=[\"dcim.view_rack\"],\n                 weight=100,\n@@ -33,7 +32,7 @@\n             HomePageItem(\n                 name=\"Device Types\",\n                 link=\"dcim:devicetype_list\",\n-                model=Rack,\n+                model=models.DeviceType,\n                 description=\"Physical hardware models by manufacturer\",\n                 permissions=[\"dcim.view_devicetype\"],\n                 weight=200,\n@@ -41,7 +40,7 @@\n             HomePageItem(\n                 name=\"Devices\",\n                 link=\"dcim:device_list\",\n-                model=Rack,\n+                model=models.Device,\n                 description=\"Rack-mounted network equipment, servers, and other devices\",\n                 permissions=[\"dcim.view_device\"],\n                 weight=300,\n@@ -49,7 +48,7 @@\n             HomePageItem(\n                 name=\"Virtual Chassis\",\n                 link=\"dcim:virtualchassis_list\",\n-                model=Rack,\n+                model=models.VirtualChassis,\n                 permissions=[\"dcim.view_virtualchassis\"],\n                 description=\"Represents a set of devices which share a common control plane\",\n                 weight=400,\n@@ -61,28 +60,28 @@\n                     HomePageItem(\n                         name=\"Cables\",\n                         link=\"dcim:cable_list\",\n-                        model=Cable,\n+                        model=models.Cable,\n                         permissions=[\"dcim.view_cable\"],\n                         weight=100,\n                     ),\n                     HomePageItem(\n                         name=\"Interfaces\",\n                         link=\"dcim:interface_connections_list\",\n-                        model=Interface,\n+                        model=models.Interface,\n                         permissions=[\"dcim.view_interface\"],\n                         weight=200,\n                     ),\n                     HomePageItem(\n                         name=\"Console\",\n                         link=\"dcim:console_connections_list\",\n-                        model=ConsolePort,\n+                        model=models.ConsolePort,\n                         permissions=[\"dcim.view_consoleport\", \"dcim.view_consoleserverport\"],\n                         weight=300,\n                     ),\n                     HomePageItem(\n                         name=\"Power\",\n                         link=\"dcim:power_connections_list\",\n-                        model=PowerOutlet,\n+                        model=models.PowerOutlet,\n                         permissions=[\"dcim.view_powerport\", \"dcim.view_poweroutlet\"],\n                         weight=400,\n                     ),\n@@ -97,7 +96,7 @@\n             HomePageItem(\n                 name=\"Power Feeds\",\n                 link=\"dcim:powerfeed_list\",\n-                model=PowerFeed,\n+                model=models.PowerFeed,\n                 description=\"Electrical circuits delivering power from panels\",\n                 permissions=[\"dcim.view_powerfeed\"],\n                 weight=100,\n@@ -105,7 +104,7 @@\n             HomePageItem(\n                 name=\"Power Panels\",\n                 link=\"dcim:powerpanel_list\",\n-                model=PowerPanel,\n+                model=models.PowerPanel,\n                 description=\"Electrical panels receiving utility power\",\n                 permissions=[\"dcim.view_powerpanel\"],\n                 weight=200,\n", "issue": "1.2 Homepage object counts for DCIM all point to Rack model\n<!--\r\n    NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED.\r\n\r\n    This form is only for reporting reproducible bugs. If you need assistance\r\n    with Nautobot installation, or if you have a general question, please start a\r\n    discussion instead: https://github.com/nautobot/nautobot/discussions\r\n\r\n    Please describe the environment in which you are running Nautobot. Be sure\r\n    that you are running an unmodified instance of the latest stable release\r\n    before submitting a bug report, and that any plugins have been disabled.\r\n-->\r\n### Environment\r\n* Python version: 3.9\r\n* Nautobot version: 1.2.0-alpha1\r\n\r\n<!--\r\n    Describe in detail the exact steps that someone else can take to reproduce\r\n    this bug using the current stable release of Nautobot. Begin with the\r\n    creation of any necessary database objects and call out every operation\r\n    being performed explicitly. If reporting a bug in the REST API, be sure to\r\n    reconstruct the raw HTTP request(s) being made: Don't rely on a client\r\n    library such as pynautobot.\r\n-->\r\n### Steps to Reproduce\r\n1. Create a set of each DCIM object which is listed on the homepage, like devices, interfaces, etc., and exactly 1 Rack\r\n2. Navigate to the home page\r\n\r\n<!-- What did you expect to happen? -->\r\n### Expected Behavior\r\nThe home page widgets for object counts for DCIM should list correct counts for each object type.\r\n\r\n<!-- What happened instead? -->\r\n### Observed Behavior\r\nOther than sites, all other DCIM object counts show the number of racks (in this case, exactly 1).\n", "before_files": [{"content": "from nautobot.dcim.models.power import PowerFeed, PowerPanel\nfrom nautobot.dcim.models import Cable, ConsolePort, Interface, PowerOutlet, Rack, Site\nfrom nautobot.core.apps import HomePageGroup, HomePageItem, HomePagePanel\n\n\nlayout = (\n    HomePagePanel(\n        name=\"Organization\",\n        weight=100,\n        items=(\n            HomePageItem(\n                name=\"Sites\",\n                link=\"dcim:site_list\",\n                model=Site,\n                description=\"Geographic location\",\n                permissions=[\"dcim.view_site\"],\n                weight=100,\n            ),\n        ),\n    ),\n    HomePagePanel(\n        name=\"DCIM\",\n        weight=200,\n        items=(\n            HomePageItem(\n                name=\"Racks\",\n                link=\"dcim:rack_list\",\n                model=Rack,\n                description=\"Equipment racks, optionally organized by group\",\n                permissions=[\"dcim.view_rack\"],\n                weight=100,\n            ),\n            HomePageItem(\n                name=\"Device Types\",\n                link=\"dcim:devicetype_list\",\n                model=Rack,\n                description=\"Physical hardware models by manufacturer\",\n                permissions=[\"dcim.view_devicetype\"],\n                weight=200,\n            ),\n            HomePageItem(\n                name=\"Devices\",\n                link=\"dcim:device_list\",\n                model=Rack,\n                description=\"Rack-mounted network equipment, servers, and other devices\",\n                permissions=[\"dcim.view_device\"],\n                weight=300,\n            ),\n            HomePageItem(\n                name=\"Virtual Chassis\",\n                link=\"dcim:virtualchassis_list\",\n                model=Rack,\n                permissions=[\"dcim.view_virtualchassis\"],\n                description=\"Represents a set of devices which share a common control plane\",\n                weight=400,\n            ),\n            HomePageGroup(\n                name=\"Connections\",\n                weight=500,\n                items=(\n                    HomePageItem(\n                        name=\"Cables\",\n                        link=\"dcim:cable_list\",\n                        model=Cable,\n                        permissions=[\"dcim.view_cable\"],\n                        weight=100,\n                    ),\n                    HomePageItem(\n                        name=\"Interfaces\",\n                        link=\"dcim:interface_connections_list\",\n                        model=Interface,\n                        permissions=[\"dcim.view_interface\"],\n                        weight=200,\n                    ),\n                    HomePageItem(\n                        name=\"Console\",\n                        link=\"dcim:console_connections_list\",\n                        model=ConsolePort,\n                        permissions=[\"dcim.view_consoleport\", \"dcim.view_consoleserverport\"],\n                        weight=300,\n                    ),\n                    HomePageItem(\n                        name=\"Power\",\n                        link=\"dcim:power_connections_list\",\n                        model=PowerOutlet,\n                        permissions=[\"dcim.view_powerport\", \"dcim.view_poweroutlet\"],\n                        weight=400,\n                    ),\n                ),\n            ),\n        ),\n    ),\n    HomePagePanel(\n        name=\"Power\",\n        weight=300,\n        items=(\n            HomePageItem(\n                name=\"Power Feeds\",\n                link=\"dcim:powerfeed_list\",\n                model=PowerFeed,\n                description=\"Electrical circuits delivering power from panels\",\n                permissions=[\"dcim.view_powerfeed\"],\n                weight=100,\n            ),\n            HomePageItem(\n                name=\"Power Panels\",\n                link=\"dcim:powerpanel_list\",\n                model=PowerPanel,\n                description=\"Electrical panels receiving utility power\",\n                permissions=[\"dcim.view_powerpanel\"],\n                weight=200,\n            ),\n        ),\n    ),\n)\n", "path": "nautobot/dcim/homepage.py"}]}