nautobot 2.3.9__py3-none-any.whl → 2.3.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of nautobot might be problematic. Click here for more details.
- nautobot/apps/utils.py +2 -0
- nautobot/cloud/tables.py +1 -0
- nautobot/core/forms/forms.py +5 -1
- nautobot/core/models/query_functions.py +147 -1
- nautobot/core/tables.py +88 -22
- nautobot/core/templates/generic/object_bulk_destroy.html +12 -3
- nautobot/core/templates/generic/object_bulk_update.html +4 -2
- nautobot/core/templates/generic/object_create.html +1 -1
- nautobot/core/templates/rest_framework/api.html +3 -0
- nautobot/core/testing/api.py +3 -1
- nautobot/core/testing/integration.py +64 -0
- nautobot/core/testing/views.py +33 -27
- nautobot/core/tests/integration/test_app_navbar.py +3 -3
- nautobot/core/tests/integration/test_navbar.py +1 -1
- nautobot/core/tests/test_csv.py +3 -0
- nautobot/core/tests/test_models_query_functions.py +108 -0
- nautobot/core/tests/test_utils.py +25 -5
- nautobot/core/utils/lookup.py +35 -0
- nautobot/core/views/generic.py +50 -39
- nautobot/core/views/mixins.py +97 -43
- nautobot/core/views/renderers.py +8 -5
- nautobot/dcim/tables/devices.py +3 -0
- nautobot/dcim/templates/dcim/device_component_add.html +8 -8
- nautobot/dcim/templates/dcim/modulebay_create.html +39 -0
- nautobot/dcim/templates/dcim/modulebay_update.html +39 -0
- nautobot/dcim/templates/dcim/virtualchassis_add_member.html +2 -2
- nautobot/dcim/templates/dcim/virtualchassis_edit.html +2 -2
- nautobot/dcim/tests/integration/test_create_device.py +86 -0
- nautobot/dcim/views.py +1 -1
- nautobot/extras/api/customfields.py +3 -10
- nautobot/extras/context_managers.py +23 -3
- nautobot/extras/jobs.py +20 -14
- nautobot/extras/models/customfields.py +12 -0
- nautobot/extras/signals.py +2 -0
- nautobot/extras/tasks.py +88 -69
- nautobot/extras/tests/test_context_managers.py +9 -4
- nautobot/extras/tests/test_relationships.py +1 -0
- nautobot/extras/tests/test_webhooks.py +1 -1
- nautobot/extras/views.py +1 -0
- nautobot/extras/webhooks.py +16 -7
- nautobot/ipam/factory.py +3 -0
- nautobot/ipam/filters.py +5 -0
- nautobot/ipam/forms.py +17 -0
- nautobot/ipam/models.py +2 -1
- nautobot/ipam/signals.py +2 -2
- nautobot/ipam/tables.py +3 -3
- nautobot/ipam/templates/ipam/ipaddress_assign.html +2 -2
- nautobot/ipam/tests/test_models.py +113 -1
- nautobot/ipam/tests/test_views.py +39 -5
- nautobot/project-static/docs/404.html +1 -1
- nautobot/project-static/docs/apps/index.html +1 -1
- nautobot/project-static/docs/apps/nautobot-apps.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/__init__.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/admin.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/api.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/change_logging.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/choices.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/config.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/constants.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/datasources.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/exceptions.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/factory.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/filters.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/forms.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/graphql.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/jobs.html +62 -5
- nautobot/project-static/docs/code-reference/nautobot/apps/models.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/querysets.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/secrets.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/tables.html +132 -7
- nautobot/project-static/docs/code-reference/nautobot/apps/testing.html +176 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/ui.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/urls.html +1 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/utils.html +95 -1
- nautobot/project-static/docs/code-reference/nautobot/apps/views.html +5 -5
- nautobot/project-static/docs/development/apps/api/configuration-view.html +1 -1
- nautobot/project-static/docs/development/apps/api/database-backend-config.html +1 -1
- nautobot/project-static/docs/development/apps/api/models/django-admin.html +1 -1
- nautobot/project-static/docs/development/apps/api/models/global-search.html +1 -1
- nautobot/project-static/docs/development/apps/api/models/graphql.html +1 -1
- nautobot/project-static/docs/development/apps/api/models/index.html +1 -1
- nautobot/project-static/docs/development/apps/api/nautobot-app-config.html +1 -1
- nautobot/project-static/docs/development/apps/api/platform-features/custom-validators.html +1 -1
- nautobot/project-static/docs/development/apps/api/platform-features/filter-extensions.html +1 -1
- nautobot/project-static/docs/development/apps/api/platform-features/git-repository-content.html +1 -1
- nautobot/project-static/docs/development/apps/api/platform-features/index.html +1 -1
- nautobot/project-static/docs/development/apps/api/platform-features/jinja2-filters.html +1 -1
- nautobot/project-static/docs/development/apps/api/platform-features/jobs.html +1 -1
- nautobot/project-static/docs/development/apps/api/platform-features/populating-extensibility-features.html +1 -1
- nautobot/project-static/docs/development/apps/api/platform-features/secrets-providers.html +1 -1
- nautobot/project-static/docs/development/apps/api/platform-features/table-extensions.html +1 -1
- nautobot/project-static/docs/development/apps/api/platform-features/uniquely-identify-objects.html +1 -1
- nautobot/project-static/docs/development/apps/api/prometheus.html +1 -1
- nautobot/project-static/docs/development/apps/api/setup.html +1 -1
- nautobot/project-static/docs/development/apps/api/testing.html +1 -1
- nautobot/project-static/docs/development/apps/api/ui-extensions/banners.html +1 -1
- nautobot/project-static/docs/development/apps/api/ui-extensions/home-page.html +1 -1
- nautobot/project-static/docs/development/apps/api/ui-extensions/index.html +1 -1
- nautobot/project-static/docs/development/apps/api/ui-extensions/navigation.html +1 -1
- nautobot/project-static/docs/development/apps/api/ui-extensions/object-views.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/base-template.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/core-view-overrides.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/django-generic-views.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/help-documentation.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/index.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/nautobot-generic-views.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/nautobotuiviewset.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/nautobotuiviewsetrouter.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/notes.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/rest-api.html +1 -1
- nautobot/project-static/docs/development/apps/api/views/urls.html +1 -1
- nautobot/project-static/docs/development/apps/index.html +1 -1
- nautobot/project-static/docs/development/apps/migration/code-updates.html +1 -1
- nautobot/project-static/docs/development/apps/migration/dependency-updates.html +1 -1
- nautobot/project-static/docs/development/apps/migration/from-v1.html +1 -1
- nautobot/project-static/docs/development/apps/migration/model-updates/dcim.html +1 -1
- nautobot/project-static/docs/development/apps/migration/model-updates/extras.html +1 -1
- nautobot/project-static/docs/development/apps/migration/model-updates/global.html +1 -1
- nautobot/project-static/docs/development/apps/migration/model-updates/ipam.html +1 -1
- nautobot/project-static/docs/development/apps/porting-from-netbox.html +1 -1
- nautobot/project-static/docs/development/core/application-registry.html +1 -1
- nautobot/project-static/docs/development/core/best-practices.html +1 -1
- nautobot/project-static/docs/development/core/bootstrap-ui.html +1 -1
- nautobot/project-static/docs/development/core/caching.html +1 -1
- nautobot/project-static/docs/development/core/controllers.html +1 -1
- nautobot/project-static/docs/development/core/docker-compose-advanced-use-cases.html +1 -1
- nautobot/project-static/docs/development/core/generic-views.html +1 -1
- nautobot/project-static/docs/development/core/getting-started.html +1 -1
- nautobot/project-static/docs/development/core/homepage.html +1 -1
- nautobot/project-static/docs/development/core/index.html +1 -1
- nautobot/project-static/docs/development/core/model-checklist.html +1 -1
- nautobot/project-static/docs/development/core/model-features.html +1 -1
- nautobot/project-static/docs/development/core/natural-keys.html +1 -1
- nautobot/project-static/docs/development/core/navigation-menu.html +1 -1
- nautobot/project-static/docs/development/core/release-checklist.html +1 -1
- nautobot/project-static/docs/development/core/role-internals.html +1 -1
- nautobot/project-static/docs/development/core/settings.html +1 -1
- nautobot/project-static/docs/development/core/style-guide.html +1 -1
- nautobot/project-static/docs/development/core/templates.html +1 -1
- nautobot/project-static/docs/development/core/testing.html +1 -1
- nautobot/project-static/docs/development/core/user-preferences.html +1 -1
- nautobot/project-static/docs/development/index.html +1 -1
- nautobot/project-static/docs/development/jobs/index.html +1 -1
- nautobot/project-static/docs/development/jobs/migration/from-v1.html +1 -1
- nautobot/project-static/docs/index.html +1 -1
- nautobot/project-static/docs/objects.inv +0 -0
- nautobot/project-static/docs/overview/application_stack.html +1 -1
- nautobot/project-static/docs/overview/design_philosophy.html +1 -1
- nautobot/project-static/docs/release-notes/index.html +1 -1
- nautobot/project-static/docs/release-notes/version-1.0.html +1 -1
- nautobot/project-static/docs/release-notes/version-1.1.html +1 -1
- nautobot/project-static/docs/release-notes/version-1.2.html +1 -1
- nautobot/project-static/docs/release-notes/version-1.3.html +1 -1
- nautobot/project-static/docs/release-notes/version-1.4.html +1 -1
- nautobot/project-static/docs/release-notes/version-1.5.html +1 -1
- nautobot/project-static/docs/release-notes/version-1.6.html +1 -1
- nautobot/project-static/docs/release-notes/version-2.0.html +1 -1
- nautobot/project-static/docs/release-notes/version-2.1.html +1 -1
- nautobot/project-static/docs/release-notes/version-2.2.html +1 -1
- nautobot/project-static/docs/release-notes/version-2.3.html +440 -140
- nautobot/project-static/docs/requirements.txt +1 -1
- nautobot/project-static/docs/search/search_index.json +1 -1
- nautobot/project-static/docs/sitemap.xml +270 -270
- nautobot/project-static/docs/sitemap.xml.gz +0 -0
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/ldap.html +1 -1
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/remote.html +1 -1
- nautobot/project-static/docs/user-guide/administration/configuration/authentication/sso.html +1 -1
- nautobot/project-static/docs/user-guide/administration/configuration/index.html +1 -1
- nautobot/project-static/docs/user-guide/administration/configuration/redis.html +1 -1
- nautobot/project-static/docs/user-guide/administration/configuration/settings.html +1 -1
- nautobot/project-static/docs/user-guide/administration/configuration/time-zones.html +1 -1
- nautobot/project-static/docs/user-guide/administration/guides/celery-queues.html +1 -1
- nautobot/project-static/docs/user-guide/administration/guides/docker.html +1 -1
- nautobot/project-static/docs/user-guide/administration/guides/health-checks.html +1 -1
- nautobot/project-static/docs/user-guide/administration/guides/permissions.html +1 -1
- nautobot/project-static/docs/user-guide/administration/guides/prometheus-metrics.html +1 -1
- nautobot/project-static/docs/user-guide/administration/guides/replicating-nautobot.html +1 -1
- nautobot/project-static/docs/user-guide/administration/guides/request-profiling.html +40 -1
- nautobot/project-static/docs/user-guide/administration/guides/s3-django-storage.html +1 -1
- nautobot/project-static/docs/user-guide/administration/guides/selinux-troubleshooting.html +1 -1
- nautobot/project-static/docs/user-guide/administration/installation/app-install.html +1 -1
- nautobot/project-static/docs/user-guide/administration/installation/external-authentication.html +1 -1
- nautobot/project-static/docs/user-guide/administration/installation/http-server.html +1 -1
- nautobot/project-static/docs/user-guide/administration/installation/index.html +1 -1
- nautobot/project-static/docs/user-guide/administration/installation/install_system.html +1 -1
- nautobot/project-static/docs/user-guide/administration/installation/nautobot.html +1 -1
- nautobot/project-static/docs/user-guide/administration/installation/services.html +1 -1
- nautobot/project-static/docs/user-guide/administration/migration/migrating-from-netbox.html +1 -1
- nautobot/project-static/docs/user-guide/administration/migration/migrating-from-postgresql.html +1 -1
- nautobot/project-static/docs/user-guide/administration/tools/nautobot-server.html +1 -1
- nautobot/project-static/docs/user-guide/administration/tools/nautobot-shell.html +1 -1
- nautobot/project-static/docs/user-guide/administration/upgrading/database-backup.html +1 -1
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/after-you-upgrade.html +1 -1
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/before-you-upgrade.html +1 -1
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/for-developers.html +1 -1
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/index.html +1 -1
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/ipam/whats-changed.html +1 -1
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/region-and-site-data-migration-guide.html +1 -1
- nautobot/project-static/docs/user-guide/administration/upgrading/from-v1/upgrading-from-nautobot-v1.html +1 -1
- nautobot/project-static/docs/user-guide/administration/upgrading/upgrading.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuit.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuittermination.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/circuits/circuittype.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/circuits/provider.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/circuits/providernetwork.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloud.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudaccount.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudnetwork.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudnetworkprefixassignment.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudresourcetype.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudservice.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/cloud/cloudservicenetworkassignment.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/cable.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleport.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleporttemplate.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverport.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/consoleserverporttemplate.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/controller.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/controllermanageddevicegroup.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/device.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebay.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicebaytemplate.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicefamily.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/deviceredundancygroup.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/devicetype.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/frontport.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/frontporttemplate.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interface.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interfaceredundancygroup.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/interfacetemplate.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/inventoryitem.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/location.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/locationtype.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/manufacturer.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/module.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/modulebay.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/modulebaytemplate.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/moduletype.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/platform.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerfeed.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlet.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/poweroutlettemplate.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerpanel.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerport.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/powerporttemplate.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rack.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rackgroup.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rackreservation.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rearport.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/rearporttemplate.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/softwareimagefile.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/softwareversion.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/dcim/virtualchassis.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/extras/configcontext.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/extras/configcontextschema.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/extras/contact.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/extras/team.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/ipam/ipaddress.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/ipam/namespace.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/ipam/prefix.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/ipam/rir.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/ipam/routetarget.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/ipam/service.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vlan.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vlangroup.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/ipam/vrf.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/overview/introduction.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/tenancy/tenant.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/tenancy/tenantgroup.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/cluster.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/clustergroup.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/clustertype.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/virtualmachine.html +1 -1
- nautobot/project-static/docs/user-guide/core-data-model/virtualization/vminterface.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/contacts-and-teams.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/custom-fields.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/creating-devices.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/creating-location-types-and-locations.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/index.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/interfaces.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/ipam.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/platforms.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/search-bar.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/tenants.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/getting-started/vlans-and-vlan-groups.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/git-data-source.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/graphql.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/ip-address-merge-tool.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/relationships.html +1 -1
- nautobot/project-static/docs/user-guide/feature-guides/software-image-files-and-versions.html +1 -1
- nautobot/project-static/docs/user-guide/index.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/change-logging.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/computedfield.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/customfield.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/customlink.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/dynamicgroup.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/exporttemplate.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/externalintegration.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/gitrepository.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/graphql.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/graphqlquery.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/imageattachment.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/index.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/job-scheduling-and-approvals.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobbutton.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/jobhook.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/jobs/models.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/napalm.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/note.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/objectmetadata.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/relationship.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/authentication.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/filtering.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/overview.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/rest-api/ui-related-endpoints.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/role.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/savedview.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/secret.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/staticgroupassociation.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/status.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/tag.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/template-filters.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/users/objectpermission.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/users/token.html +1 -1
- nautobot/project-static/docs/user-guide/platform-functionality/webhook.html +1 -1
- nautobot/project-static/js/forms.js +0 -38
- nautobot/virtualization/forms.py +24 -0
- nautobot/virtualization/templates/virtualization/vminterface_edit.html +1 -0
- nautobot/virtualization/tests/test_views.py +7 -2
- {nautobot-2.3.9.dist-info → nautobot-2.3.11.dist-info}/METADATA +2 -2
- {nautobot-2.3.9.dist-info → nautobot-2.3.11.dist-info}/RECORD +335 -331
- {nautobot-2.3.9.dist-info → nautobot-2.3.11.dist-info}/LICENSE.txt +0 -0
- {nautobot-2.3.9.dist-info → nautobot-2.3.11.dist-info}/NOTICE +0 -0
- {nautobot-2.3.9.dist-info → nautobot-2.3.11.dist-info}/WHEEL +0 -0
- {nautobot-2.3.9.dist-info → nautobot-2.3.11.dist-info}/entry_points.txt +0 -0
|
@@ -9,9 +9,10 @@ from django.utils.timezone import make_aware
|
|
|
9
9
|
from netaddr import IPNetwork
|
|
10
10
|
|
|
11
11
|
from nautobot.circuits.models import Circuit, Provider
|
|
12
|
-
from nautobot.core.templatetags.helpers import queryset_to_pks
|
|
12
|
+
from nautobot.core.templatetags.helpers import hyperlinked_object, queryset_to_pks
|
|
13
13
|
from nautobot.core.testing import ModelViewTestCase, post_data, ViewTestCases
|
|
14
14
|
from nautobot.core.testing.utils import extract_page_body
|
|
15
|
+
from nautobot.core.utils.lookup import get_route_for_model
|
|
15
16
|
from nautobot.dcim.models import Device, DeviceType, Interface, Location, LocationType, Manufacturer
|
|
16
17
|
from nautobot.extras.choices import CustomFieldTypeChoices, RelationshipTypeChoices
|
|
17
18
|
from nautobot.extras.models import (
|
|
@@ -178,6 +179,24 @@ class PrefixTestCase(ViewTestCases.PrimaryObjectViewTestCase, ViewTestCases.List
|
|
|
178
179
|
"remove_vrfs": [vrfs[1].pk],
|
|
179
180
|
}
|
|
180
181
|
|
|
182
|
+
@override_settings(EXEMPT_VIEW_PERMISSIONS=[])
|
|
183
|
+
def test_list_objects_with_permission(self):
|
|
184
|
+
"""Test rendering of LinkedCountColumn for related fields."""
|
|
185
|
+
response = super().test_list_objects_with_permission()
|
|
186
|
+
response_body = extract_page_body(response.content.decode(response.charset))
|
|
187
|
+
|
|
188
|
+
locations_list_url = reverse(get_route_for_model(Location, "list"))
|
|
189
|
+
|
|
190
|
+
for prefix in self._get_queryset().all():
|
|
191
|
+
if str(prefix.pk) in response_body:
|
|
192
|
+
count = prefix.locations.count()
|
|
193
|
+
if count > 1:
|
|
194
|
+
self.assertBodyContains(
|
|
195
|
+
response, f'<a href="{locations_list_url}?prefixes={prefix.pk}" class="badge">{count}</a>'
|
|
196
|
+
)
|
|
197
|
+
elif count == 1:
|
|
198
|
+
self.assertBodyContains(response, hyperlinked_object(prefix.locations.first()))
|
|
199
|
+
|
|
181
200
|
@override_settings(EXEMPT_VIEW_PERMISSIONS=["*"])
|
|
182
201
|
def test_empty_queryset(self):
|
|
183
202
|
"""
|
|
@@ -1043,7 +1062,7 @@ class VLANTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
|
1043
1062
|
def setUpTestData(cls):
|
|
1044
1063
|
cls.locations = Location.objects.filter(location_type=LocationType.objects.get(name="Campus"))
|
|
1045
1064
|
|
|
1046
|
-
vlangroups = (
|
|
1065
|
+
cls.vlangroups = (
|
|
1047
1066
|
VLANGroup.objects.create(name="VLAN Group 1", location=cls.locations.first()),
|
|
1048
1067
|
VLANGroup.objects.create(name="VLAN Group 2", location=cls.locations.last()),
|
|
1049
1068
|
)
|
|
@@ -1053,25 +1072,40 @@ class VLANTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
|
1053
1072
|
status = Status.objects.get_for_model(VLAN).first()
|
|
1054
1073
|
|
|
1055
1074
|
cls.form_data = {
|
|
1056
|
-
"vlan_group": vlangroups[
|
|
1075
|
+
"vlan_group": cls.vlangroups[0].pk,
|
|
1057
1076
|
"vid": 999,
|
|
1058
1077
|
"name": "VLAN999 with an unwieldy long name since we increased the limit to more than 64 characters",
|
|
1059
1078
|
"tenant": None,
|
|
1060
1079
|
"status": status.pk,
|
|
1061
1080
|
"role": roles[1].pk,
|
|
1062
|
-
"locations": list(cls.locations.values_list("pk", flat=True)[:
|
|
1081
|
+
"locations": list(cls.locations.values_list("pk", flat=True)[:1]),
|
|
1063
1082
|
"description": "A new VLAN",
|
|
1064
1083
|
"tags": [t.pk for t in Tag.objects.get_for_model(VLAN)],
|
|
1065
1084
|
}
|
|
1066
1085
|
|
|
1067
1086
|
cls.bulk_edit_data = {
|
|
1068
|
-
"vlan_group": vlangroups[0].pk,
|
|
1087
|
+
"vlan_group": cls.vlangroups[0].pk,
|
|
1069
1088
|
"tenant": Tenant.objects.first().pk,
|
|
1070
1089
|
"status": status.pk,
|
|
1071
1090
|
"role": roles[0].pk,
|
|
1072
1091
|
"description": "New description",
|
|
1073
1092
|
}
|
|
1074
1093
|
|
|
1094
|
+
@override_settings(EXEMPT_VIEW_PERMISSIONS=["*"])
|
|
1095
|
+
def test_vlan_group_not_belong_to_vlan_locations(self):
|
|
1096
|
+
"""Test that a VLAN cannot be assigned to a VLAN Group that is not in the same location as the VLAN."""
|
|
1097
|
+
vlan_group = self.vlangroups[0]
|
|
1098
|
+
form_data = self.form_data.copy()
|
|
1099
|
+
form_data["vlan_group"] = vlan_group.pk
|
|
1100
|
+
form_data["locations"] = [self.locations.last().pk]
|
|
1101
|
+
self.add_permissions("ipam.add_vlan")
|
|
1102
|
+
request = {
|
|
1103
|
+
"path": self._get_url("add"),
|
|
1104
|
+
"data": post_data(form_data),
|
|
1105
|
+
}
|
|
1106
|
+
response = self.client.post(**request)
|
|
1107
|
+
self.assertBodyContains(response, f"vlan_group: VLAN Group {vlan_group} is not in locations")
|
|
1108
|
+
|
|
1075
1109
|
|
|
1076
1110
|
class ServiceTestCase(ViewTestCases.PrimaryObjectViewTestCase):
|
|
1077
1111
|
model = Service
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
<link rel="icon" href="../../../assets/favicon.ico">
|
|
21
|
-
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.
|
|
21
|
+
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.42">
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -11922,7 +11922,7 @@ an actual instance of the class.</p>
|
|
|
11922
11922
|
|
|
11923
11923
|
|
|
11924
11924
|
<h2 id="nautobot.apps.jobs.enqueue_job_hooks" class="doc doc-heading">
|
|
11925
|
-
<code class="highlight language-python"><span class="n">nautobot</span><span class="o">.</span><span class="n">apps</span><span class="o">.</span><span class="n">jobs</span><span class="o">.</span><span class="n">enqueue_job_hooks</span><span class="p">(</span><span class="n">object_change</span><span class="p">,</span> <span class="n">may_reload_jobs</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></code>
|
|
11925
|
+
<code class="highlight language-python"><span class="n">nautobot</span><span class="o">.</span><span class="n">apps</span><span class="o">.</span><span class="n">jobs</span><span class="o">.</span><span class="n">enqueue_job_hooks</span><span class="p">(</span><span class="n">object_change</span><span class="p">,</span> <span class="n">may_reload_jobs</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">jobhook_queryset</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span></code>
|
|
11926
11926
|
|
|
11927
11927
|
<a href="#nautobot.apps.jobs.enqueue_job_hooks" class="headerlink" title="Permanent link">¶</a></h2>
|
|
11928
11928
|
|
|
@@ -11932,6 +11932,63 @@ an actual instance of the class.</p>
|
|
|
11932
11932
|
<p>Find job hook(s) assigned to this changed object type + action and enqueue them to be processed.</p>
|
|
11933
11933
|
|
|
11934
11934
|
|
|
11935
|
+
<p><span class="doc-section-title">Parameters:</span></p>
|
|
11936
|
+
<table>
|
|
11937
|
+
<thead>
|
|
11938
|
+
<tr>
|
|
11939
|
+
<th>Name</th>
|
|
11940
|
+
<th>Type</th>
|
|
11941
|
+
<th>Description</th>
|
|
11942
|
+
<th>Default</th>
|
|
11943
|
+
</tr>
|
|
11944
|
+
</thead>
|
|
11945
|
+
<tbody>
|
|
11946
|
+
<tr class="doc-section-item">
|
|
11947
|
+
<td><code>object_change</code></td>
|
|
11948
|
+
<td>
|
|
11949
|
+
<code><autoref identifier="nautobot.extras.models.ObjectChange" optional hover>ObjectChange</autoref></code>
|
|
11950
|
+
</td>
|
|
11951
|
+
<td>
|
|
11952
|
+
<div class="doc-md-description">
|
|
11953
|
+
<p>The change that may trigger JobHooks to execute.</p>
|
|
11954
|
+
</div>
|
|
11955
|
+
</td>
|
|
11956
|
+
<td>
|
|
11957
|
+
<em>required</em>
|
|
11958
|
+
</td>
|
|
11959
|
+
</tr>
|
|
11960
|
+
<tr class="doc-section-item">
|
|
11961
|
+
<td><code>may_reload_jobs</code></td>
|
|
11962
|
+
<td>
|
|
11963
|
+
<code><autoref identifier="bool" optional>bool</autoref></code>
|
|
11964
|
+
</td>
|
|
11965
|
+
<td>
|
|
11966
|
+
<div class="doc-md-description">
|
|
11967
|
+
<p>Whether to reload JobHook source code from disk to guarantee up-to-date code.</p>
|
|
11968
|
+
</div>
|
|
11969
|
+
</td>
|
|
11970
|
+
<td>
|
|
11971
|
+
<code>True</code>
|
|
11972
|
+
</td>
|
|
11973
|
+
</tr>
|
|
11974
|
+
<tr class="doc-section-item">
|
|
11975
|
+
<td><code>jobhook_queryset</code></td>
|
|
11976
|
+
<td>
|
|
11977
|
+
<code><autoref identifier="django.db.models.query.QuerySet" optional hover>QuerySet</autoref></code>
|
|
11978
|
+
</td>
|
|
11979
|
+
<td>
|
|
11980
|
+
<div class="doc-md-description">
|
|
11981
|
+
<p>Previously retrieved set of JobHooks to potentially enqueue</p>
|
|
11982
|
+
</div>
|
|
11983
|
+
</td>
|
|
11984
|
+
<td>
|
|
11985
|
+
<code>None</code>
|
|
11986
|
+
</td>
|
|
11987
|
+
</tr>
|
|
11988
|
+
</tbody>
|
|
11989
|
+
</table>
|
|
11990
|
+
|
|
11991
|
+
|
|
11935
11992
|
<p><span class="doc-section-title">Returns:</span></p>
|
|
11936
11993
|
<table>
|
|
11937
11994
|
<thead>
|
|
@@ -11942,12 +11999,12 @@ an actual instance of the class.</p>
|
|
|
11942
11999
|
</thead>
|
|
11943
12000
|
<tbody>
|
|
11944
12001
|
<tr class="doc-section-item">
|
|
11945
|
-
<td><code>
|
|
11946
|
-
<code><autoref identifier="bool" optional>bool</autoref
|
|
12002
|
+
<td><code>result</code></td> <td>
|
|
12003
|
+
<code><autoref identifier="tuple" optional>tuple</autoref>[<autoref identifier="bool" optional>bool</autoref>, <autoref identifier="django.db.models.query.QuerySet" optional hover>QuerySet</autoref>]</code>
|
|
11947
12004
|
</td>
|
|
11948
12005
|
<td>
|
|
11949
12006
|
<div class="doc-md-description">
|
|
11950
|
-
<p>whether Jobs were reloaded
|
|
12007
|
+
<p>whether Jobs were reloaded here, and the jobhooks that were considered</p>
|
|
11951
12008
|
</div>
|
|
11952
12009
|
</td>
|
|
11953
12010
|
</tr>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
<link rel="icon" href="../../../assets/favicon.ico">
|
|
21
|
-
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.
|
|
21
|
+
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.42">
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -9444,12 +9444,137 @@ set <code>sort_items=False</code>.</p>
|
|
|
9444
9444
|
Bases: <code><autoref identifier="django_tables2.Column" optional hover>Column</autoref></code></p>
|
|
9445
9445
|
|
|
9446
9446
|
|
|
9447
|
-
<p>Render a count of related objects linked to a filtered URL.</p>
|
|
9448
|
-
|
|
9449
|
-
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9447
|
+
<p>Render a count of related objects linked to a filtered URL, or if a single related object is present, the object.</p>
|
|
9448
|
+
|
|
9449
|
+
|
|
9450
|
+
<p><span class="doc-section-title">Parameters:</span></p>
|
|
9451
|
+
<table>
|
|
9452
|
+
<thead>
|
|
9453
|
+
<tr>
|
|
9454
|
+
<th>Name</th>
|
|
9455
|
+
<th>Type</th>
|
|
9456
|
+
<th>Description</th>
|
|
9457
|
+
<th>Default</th>
|
|
9458
|
+
</tr>
|
|
9459
|
+
</thead>
|
|
9460
|
+
<tbody>
|
|
9461
|
+
<tr class="doc-section-item">
|
|
9462
|
+
<td><code>viewname</code></td>
|
|
9463
|
+
<td>
|
|
9464
|
+
<code><autoref identifier="str" optional>str</autoref></code>
|
|
9465
|
+
</td>
|
|
9466
|
+
<td>
|
|
9467
|
+
<div class="doc-md-description">
|
|
9468
|
+
<p>The list view name to use for URL resolution, for example <code>"dcim:location_list"</code></p>
|
|
9469
|
+
</div>
|
|
9470
|
+
</td>
|
|
9471
|
+
<td>
|
|
9472
|
+
<em>required</em>
|
|
9473
|
+
</td>
|
|
9474
|
+
</tr>
|
|
9475
|
+
<tr class="doc-section-item">
|
|
9476
|
+
<td><code>url_params</code></td>
|
|
9477
|
+
<td>
|
|
9478
|
+
<code><autoref identifier="dict" optional>dict</autoref></code>
|
|
9479
|
+
</td>
|
|
9480
|
+
<td>
|
|
9481
|
+
<div class="doc-md-description">
|
|
9482
|
+
<p>Query parameters to apply to filter the list URL (e.g. <code>{"vlans": "pk"}</code> will add
|
|
9483
|
+
<code>?vlans=<record.pk></code> to the linked list URL)</p>
|
|
9484
|
+
</div>
|
|
9485
|
+
</td>
|
|
9486
|
+
<td>
|
|
9487
|
+
<code>None</code>
|
|
9488
|
+
</td>
|
|
9489
|
+
</tr>
|
|
9490
|
+
<tr class="doc-section-item">
|
|
9491
|
+
<td><code>view_kwargs</code></td>
|
|
9492
|
+
<td>
|
|
9493
|
+
<code><autoref identifier="dict" optional>dict</autoref></code>
|
|
9494
|
+
</td>
|
|
9495
|
+
<td>
|
|
9496
|
+
<div class="doc-md-description">
|
|
9497
|
+
<p>Additional kwargs to pass to <code>reverse()</code> for list URL resolution. Rarely used.</p>
|
|
9498
|
+
</div>
|
|
9499
|
+
</td>
|
|
9500
|
+
<td>
|
|
9501
|
+
<code>None</code>
|
|
9502
|
+
</td>
|
|
9503
|
+
</tr>
|
|
9504
|
+
<tr class="doc-section-item">
|
|
9505
|
+
<td><code>lookup</code></td>
|
|
9506
|
+
<td>
|
|
9507
|
+
<code><autoref identifier="str" optional>str</autoref></code>
|
|
9508
|
+
</td>
|
|
9509
|
+
<td>
|
|
9510
|
+
<div class="doc-md-description">
|
|
9511
|
+
<p>The field name on the base record that can be used to query the related objects.
|
|
9512
|
+
If not specified, <code>nautobot.core.utils.lookup.get_related_field_for_models()</code> will be called at render time
|
|
9513
|
+
to attempt to intelligently find the appropriate field.
|
|
9514
|
+
TODO: this currently does <em>not</em> support nested lookups via <code>__</code>. That may be solvable in the future.</p>
|
|
9515
|
+
</div>
|
|
9516
|
+
</td>
|
|
9517
|
+
<td>
|
|
9518
|
+
<code>None</code>
|
|
9519
|
+
</td>
|
|
9520
|
+
</tr>
|
|
9521
|
+
<tr class="doc-section-item">
|
|
9522
|
+
<td><code>reverse_lookup</code></td>
|
|
9523
|
+
<td>
|
|
9524
|
+
<code><autoref identifier="str" optional>str</autoref></code>
|
|
9525
|
+
</td>
|
|
9526
|
+
<td>
|
|
9527
|
+
<div class="doc-md-description">
|
|
9528
|
+
<p>The reverse lookup parameter to use to derive the count.
|
|
9529
|
+
If not specified, the first key in <code>url_params</code> will be implicitly used as the <code>reverse_lookup</code> value.</p>
|
|
9530
|
+
</div>
|
|
9531
|
+
</td>
|
|
9532
|
+
<td>
|
|
9533
|
+
<code>None</code>
|
|
9534
|
+
</td>
|
|
9535
|
+
</tr>
|
|
9536
|
+
<tr class="doc-section-item">
|
|
9537
|
+
<td><code>**kwargs</code></td>
|
|
9538
|
+
<td>
|
|
9539
|
+
<code><autoref identifier="dict" optional>dict</autoref></code>
|
|
9540
|
+
</td>
|
|
9541
|
+
<td>
|
|
9542
|
+
<div class="doc-md-description">
|
|
9543
|
+
<p>As the parent Column class.</p>
|
|
9544
|
+
</div>
|
|
9545
|
+
</td>
|
|
9546
|
+
<td>
|
|
9547
|
+
<code>{}</code>
|
|
9548
|
+
</td>
|
|
9549
|
+
</tr>
|
|
9550
|
+
</tbody>
|
|
9551
|
+
</table>
|
|
9552
|
+
|
|
9553
|
+
|
|
9554
|
+
<p><span class="doc-section-title">Examples:</span></p>
|
|
9555
|
+
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="k">class</span> <span class="nc">VLANTable</span><span class="p">(</span><span class="o">...</span><span class="p">,</span> <span class="n">BaseTable</span><span class="p">):</span>
|
|
9556
|
+
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a> <span class="o">...</span>
|
|
9557
|
+
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a> <span class="n">location_count</span> <span class="o">=</span> <span class="n">LinkedCountColumn</span><span class="p">(</span>
|
|
9558
|
+
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a> <span class="c1"># Link for N related locations will be reverse("dcim:location_list") + "?vlans=<record.pk>"</span>
|
|
9559
|
+
<a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a> <span class="n">viewname</span><span class="o">=</span><span class="s2">"dcim:location_list"</span><span class="p">,</span>
|
|
9560
|
+
<a id="__codelineno-0-6" name="__codelineno-0-6" href="#__codelineno-0-6"></a> <span class="n">url_params</span><span class="o">=</span><span class="p">{</span><span class="s2">"vlans"</span><span class="p">:</span> <span class="s2">"pk"</span><span class="p">},</span>
|
|
9561
|
+
<a id="__codelineno-0-7" name="__codelineno-0-7" href="#__codelineno-0-7"></a> <span class="n">verbose_name</span><span class="o">=</span><span class="s2">"Locations"</span><span class="p">,</span>
|
|
9562
|
+
<a id="__codelineno-0-8" name="__codelineno-0-8" href="#__codelineno-0-8"></a> <span class="p">)</span>
|
|
9563
|
+
</code></pre></div>
|
|
9564
|
+
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="k">class</span> <span class="nc">CloudNetworkTable</span><span class="p">(</span><span class="n">BaseTable</span><span class="p">):</span>
|
|
9565
|
+
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a> <span class="o">...</span>
|
|
9566
|
+
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a> <span class="n">circuit_count</span> <span class="o">=</span> <span class="n">LinkedCountColumn</span><span class="p">(</span>
|
|
9567
|
+
<a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a> <span class="c1"># Link for N related circuits will be reverse("circuits:circuit_list") + "?cloud_network=<record.name>"</span>
|
|
9568
|
+
<a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a> <span class="n">viewname</span><span class="o">=</span><span class="s2">"circuits:circuit_list"</span><span class="p">,</span>
|
|
9569
|
+
<a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a> <span class="n">url_params</span><span class="o">=</span><span class="p">{</span><span class="s2">"cloud_network"</span><span class="p">:</span> <span class="s2">"name"</span><span class="p">},</span>
|
|
9570
|
+
<a id="__codelineno-1-7" name="__codelineno-1-7" href="#__codelineno-1-7"></a> <span class="c1"># We'd like to do the below but this module isn't currently smart enough to build the right Prefetch()</span>
|
|
9571
|
+
<a id="__codelineno-1-8" name="__codelineno-1-8" href="#__codelineno-1-8"></a> <span class="c1"># for a nested lookup:</span>
|
|
9572
|
+
<a id="__codelineno-1-9" name="__codelineno-1-9" href="#__codelineno-1-9"></a> <span class="c1"># lookup="circuit_terminations__circuit",</span>
|
|
9573
|
+
<a id="__codelineno-1-10" name="__codelineno-1-10" href="#__codelineno-1-10"></a> <span class="c1"># For the count, .annotate(circuit_count=count_related(Circuit, "circuit_terminations__cloud_network"))</span>
|
|
9574
|
+
<a id="__codelineno-1-11" name="__codelineno-1-11" href="#__codelineno-1-11"></a> <span class="n">reverse_lookup</span><span class="o">=</span><span class="s2">"circuit_terminations__cloud_network"</span><span class="p">,</span>
|
|
9575
|
+
<a id="__codelineno-1-12" name="__codelineno-1-12" href="#__codelineno-1-12"></a> <span class="n">verbose_name</span><span class="o">=</span><span class="s2">"Circuits"</span><span class="p">,</span>
|
|
9576
|
+
<a id="__codelineno-1-13" name="__codelineno-1-13" href="#__codelineno-1-13"></a> <span class="p">)</span>
|
|
9577
|
+
</code></pre></div>
|
|
9453
9578
|
|
|
9454
9579
|
|
|
9455
9580
|
|