mirror of
https://github.com/netbox-community/netbox.git
synced 2026-03-22 09:30:09 +01:00
* 7699 Add Scope to Cluster * 7699 Serializer * 7699 filterset * 7699 bulk_edit * 7699 bulk_import * 7699 model_form * 7699 graphql, tables * 7699 fixes * 7699 fixes * 7699 fixes * 7699 fixes * 7699 fix tests * 7699 fix graphql tests for clusters reference * 7699 fix dcim tests * 7699 fix ipam tests * 7699 fix tests * 7699 use mixin for model * 7699 change mixin name * 7699 scope form * 7699 scope form * 7699 scoped form, fitlerset * 7699 review changes * 7699 move ScopedFilterset * 7699 move CachedScopeMixin * 7699 review changes * 7699 review changes * 7699 refactor mixins * 7699 _sitegroup -> _site_group * 7699 update docstring * Misc cleanup * Update migrations --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
25 lines
648 B
Python
25 lines
648 B
Python
from django.apps import AppConfig
|
|
|
|
from netbox import denormalized
|
|
|
|
|
|
class VirtualizationConfig(AppConfig):
|
|
name = 'virtualization'
|
|
|
|
def ready(self):
|
|
from netbox.models.features import register_models
|
|
from utilities.counters import connect_counters
|
|
from . import search, signals # noqa: F401
|
|
from .models import VirtualMachine
|
|
|
|
# Register models
|
|
register_models(*self.get_models())
|
|
|
|
# Register denormalized fields
|
|
denormalized.register(VirtualMachine, 'cluster', {
|
|
'site': '_site',
|
|
})
|
|
|
|
# Register counters
|
|
connect_counters(VirtualMachine)
|