Skip to main content

django-sqlitetrigger

SQLite trigger support integrated with Django models.

Inspired by django-pgtrigger, this package provides declarative trigger support for SQLite-backed Django projects. I'm very grateful for the existence of django-pgtrigger, without which I don't think this package could exist.

AI disclosure

To be super clear: this project was built by prompting GitHub Copilot to modify django-pgtrigger for use with SQLite. I was in the process of doing something very similar manually, when it dawned on me that this is the ideal use for today's agentic AI coding systems.

The resulting package is usable by me for my purposes. As the license notes, it comes with no warranty or expectation that it'll solve your problems.

Quick start

Install and add sqlitetrigger to INSTALLED_APPS:

INSTALLED_APPS = [
    "sqlitetrigger",
    # ...
]

Add triggers to your models:

import sqlitetrigger

class ProtectedModel(models.Model):
    """This model cannot be deleted!"""

    class Meta:
        triggers = [
            sqlitetrigger.Protect(name="protect_deletes", operation=sqlitetrigger.Delete)
        ]

Install triggers:

python manage.py sqlitetrigger install

Built-in triggers

  • Protect — prevent insert, update, or delete operations
  • ReadOnly — prevent changes to specific fields
  • SoftDelete — intercept deletes and set a field instead
  • FSM — enforce valid field state transitions

Running tests

uv run pytest

Metadata

Release files for django-sqlitetrigger 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-sqlitetrigger 0.1.1
File Size Uploaded Provenance Actions
django_sqlitetrigger-0.1.1.tar.gz 35.9 kB Without provenance Details for django_sqlitetrigger-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-sqlitetrigger 0.1.1
File Interpreter ABI Platform Actions
django_sqlitetrigger-0.1.1-py3-none-any.whl Python 3 none any Details for django_sqlitetrigger-0.1.1-py3-none-any.whl

Total release size: 54.6 kB

Release files / django_sqlitetrigger-0.1.1.tar.gz

Download URL django_sqlitetrigger-0.1.1.tar.gz
Size 35.9 kB
Tags Source
SHA-256 checksum
How to use checksums
7904355ec8c49d271ae1e70d31f189ca48793125dd4124905129db5a84d8c174
BLAKE2b-256 checksum
How to use checksums
83bee1312587077210db17223b5563767322bc9e096625e68c2c5085be84ce45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.1 {"installer":{"name":"uv","version":"0.10.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / django_sqlitetrigger-0.1.1-py3-none-any.whl

Download URL django_sqlitetrigger-0.1.1-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61e389464b92e9d9ded0a7470f91a2fc761494240035509c5e35770ae7890d00
BLAKE2b-256 checksum
How to use checksums
fae7d69283045a794ab345f915f9267c8f9cf663a90f43a095a128010a49f172
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.1 {"installer":{"name":"uv","version":"0.10.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for django-sqlitetrigger 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page