mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-18 18:26:27 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5ed095738 | ||
|
|
b70f1211ab | ||
|
|
c094699dc0 | ||
|
|
5f77d684e1 | ||
|
|
f23eb53312 | ||
|
|
91d5d284ca | ||
|
|
c4dcc62c04 | ||
|
|
26fc06b817 |
8
.github/codeql/codeql-config.yml
vendored
8
.github/codeql/codeql-config.yml
vendored
@ -1,3 +1,11 @@
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
# Ignore compiled JS
|
# Ignore compiled JS
|
||||||
- netbox/project-static/dist
|
- netbox/project-static/dist
|
||||||
|
|
||||||
|
query-filters:
|
||||||
|
# Exclude py/url-redirection: NetBox uses safe_for_redirect() wrapper function
|
||||||
|
# which validates all redirects via Django's url_has_allowed_host_and_scheme().
|
||||||
|
# CodeQL's taint tracking doesn't recognize wrapper functions without custom
|
||||||
|
# query configuration. See #20484.
|
||||||
|
- exclude:
|
||||||
|
id: py/url-redirection
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# Filters & Filter Sets
|
# Filters & Filter Sets
|
||||||
|
|
||||||
Filter sets define the mechanisms available for filtering or searching through a set of objects in NetBox. For instance, sites can be filtered by their parent region or group, status, facility ID, and so on. The same filter set is used consistently for a model whether the request is made via the UI or REST API. (Note that the GraphQL API uses a separate filter class.) NetBox employs the [django-filters2](https://django-tables2.readthedocs.io/en/latest/) library to define filter sets.
|
Filter sets define the mechanisms available for filtering or searching through a set of objects in NetBox. For instance, sites can be filtered by their parent region or group, status, facility ID, and so on. The same filter set is used consistently for a model whether the request is made via the UI or REST API. (Note that the GraphQL API uses a separate filter class.) NetBox employs the [django-filter](https://django-filter.readthedocs.io/en/stable/) library to define filter sets.
|
||||||
|
|
||||||
## FilterSet Classes
|
## FilterSet Classes
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
from django.apps import AppConfig
|
from django.apps import AppConfig
|
||||||
|
|
||||||
|
from netbox import denormalized
|
||||||
|
|
||||||
|
|
||||||
class CircuitsConfig(AppConfig):
|
class CircuitsConfig(AppConfig):
|
||||||
name = "circuits"
|
name = "circuits"
|
||||||
@ -8,6 +10,16 @@ class CircuitsConfig(AppConfig):
|
|||||||
def ready(self):
|
def ready(self):
|
||||||
from netbox.models.features import register_models
|
from netbox.models.features import register_models
|
||||||
from . import signals, search # noqa: F401
|
from . import signals, search # noqa: F401
|
||||||
|
from .models import CircuitTermination
|
||||||
|
|
||||||
# Register models
|
# Register models
|
||||||
register_models(*self.get_models())
|
register_models(*self.get_models())
|
||||||
|
|
||||||
|
denormalized.register(CircuitTermination, '_site', {
|
||||||
|
'_region': 'region',
|
||||||
|
'_site_group': 'group',
|
||||||
|
})
|
||||||
|
|
||||||
|
denormalized.register(CircuitTermination, '_location', {
|
||||||
|
'_site': 'site',
|
||||||
|
})
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import datetime
|
import datetime
|
||||||
import importlib
|
import importlib
|
||||||
import importlib.util
|
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
|
|||||||
@ -3,9 +3,7 @@ import django.db.models.deletion
|
|||||||
import taggit.managers
|
import taggit.managers
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|
||||||
import utilities.fields
|
|
||||||
import utilities.json
|
import utilities.json
|
||||||
import utilities.ordering
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@ -548,7 +548,7 @@ class IPRange(ContactsMixin, PrimaryModel):
|
|||||||
mark_utilized = models.BooleanField(
|
mark_utilized = models.BooleanField(
|
||||||
verbose_name=_('mark utilized'),
|
verbose_name=_('mark utilized'),
|
||||||
default=False,
|
default=False,
|
||||||
help_text=_("Report space as 100% utilized")
|
help_text=_("Report space as fully utilized")
|
||||||
)
|
)
|
||||||
|
|
||||||
clone_fields = (
|
clone_fields = (
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user