Skip to content

Consumables Tracking API Package

nautobot_consumables

App config declaration for Nautobot Consumables.

NautobotConsumablesConfig

Bases: NautobotAppConfig

Plugin configuration for Consumables.

Source code in nautobot_consumables/__init__.py
class NautobotConsumablesConfig(NautobotAppConfig):
    """Plugin configuration for Consumables."""

    name: str = "nautobot_consumables"
    verbose_name: str = "Consumables Tracking for Nautobot"
    version: str = f"{__version__}"
    author: str = f"{dist.metadata.get('Author')}"  # type: ignore[attr-defined]
    author_email: str = f"{dist.metadata.get('Author-email')}"  # type: ignore[attr-defined]
    description: str = f"{dist.metadata.get('Summary')}"  # type: ignore[attr-defined]
    base_url = "consumables"
    docs_view_name = "plugins:nautobot_consumables:docs"
    required_settings: list[str] = []
    min_version: str = "1.6.1"
    max_version: str = "1.9999"
    caching_config: dict[str, str | dict[str, str]] = {}

    def ready(self) -> None:
        """Register custom signals at startup."""
        # pylint:disable=import-outside-toplevel
        from nautobot_consumables import signals
        post_migrate.connect(signals.post_migrate_create_defaults, sender=self)

        super().ready()

ready()

Register custom signals at startup.

Source code in nautobot_consumables/__init__.py
def ready(self) -> None:
    """Register custom signals at startup."""
    # pylint:disable=import-outside-toplevel
    from nautobot_consumables import signals
    post_migrate.connect(signals.post_migrate_create_defaults, sender=self)

    super().ready()