{"categories":[{"label":"Application Frameworks","url":"https://skillfed.io/packages/category/software-development-libraries-application-frameworks/4"}],"enrichment":{"capability":"Adds declarative lifecycle hooks to Django models via a @hook decorator, letting you run code at specific model events (before/after create, update, delete) without overriding save() or using Signals.","skillfed_tags":["django-models","lifecycle-hooks","orm-utilities"],"use_cases":["Automatically update a timestamp field whenever a model's content changes, without overriding save().","Trigger side effects (like sending emails) only when a model transitions between specific states (e.g., draft to published).","Run validation or cleanup logic before or after a model is created, updated, or deleted, with fine-grained conditions.","Track field changes and react to them in the same model class, keeping related logic together and readable.","Replace Signal handlers for simple lifecycle events when you want less indirection and clearer code flow."],"what_it_does":"Django Lifecycle Hooks provides a decorator-based alternative to Django Signals for attaching code to model lifecycle events. Instead of overriding save() or __init__ and manually tracking field changes, you decorate methods with @hook and specify when they should run (before/after create, update, or delete) and under what conditions. The package includes a LifecycleModel base class and condition helpers like WhenFieldHasChanged and WhenFieldValueIs to express complex logic declaratively.\n\nThe main appeal is readability and maintainability: lifecycle logic stays close to the model definition rather than scattered across signal handlers. It works with Django 4.2, 5.0, 5.2, and 6.0, and supports Python 3.8 through 3.14. The package has been in active development since 2018 and carries no known security vulnerabilities.","worth_installing":"Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and solves a real readability problem in Django projects. It's a straightforward drop-in for teams that find Signals cumbersome and prefer declarative, co-located lifecycle logic. The MIT license imposes no restrictions."},"id":"django-lifecycle","links":{"html":"https://skillfed.io/packages/django-lifecycle","md":"https://skillfed.io/packages/django-lifecycle.md","pypi":"https://pypi.org/project/django-lifecycle/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-06-14","license_spdx":null,"license_treatment":"permissive","name":"django-lifecycle","python_support":"unspecified","summary":"Declarative model lifecycle hooks."},"popularity":{"monthly_downloads":257820,"position":8434,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.3.0"}
