mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Implement RestrictedQuerySet as a manager
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from django.db import models
|
||||
|
||||
from ipam.lookups import Host, Inet
|
||||
from utilities.querysets import RestrictedQuerySet
|
||||
|
||||
|
||||
class IPAddressManager(models.Manager):
|
||||
@@ -13,5 +14,5 @@ class IPAddressManager(models.Manager):
|
||||
then re-cast this value to INET() so that records will be ordered properly. We are essentially re-casting each
|
||||
IP address as a /32 or /128.
|
||||
"""
|
||||
qs = super().get_queryset()
|
||||
qs = RestrictedQuerySet(self.model, using=self._db)
|
||||
return qs.order_by(Inet(Host('address')))
|
||||
|
Reference in New Issue
Block a user