Skip to main content
#django-singleactiveobject

Model mixin that ensures there is only one active model instance in your database.

## What is this app good for?
This might come in handy if you store some sort of configuration in your database
but want to be sure there is only one active entry at a time.

## How it works

Upon save() this will check if the current object is active=True and will set
any other active object to active=False ensuring there is only one active.

## Download/Install

### using pip

pip install django-singleactiveobject

### github

git clone https://github.com/byteweaver/django-singleactiveobject

## Usage

```python
from singleactiveobject.models import SingleActiveObjectMixin

class YourModel(SingleActiveObjectMixin):
...your stuff
```

## Testing

Just run the makefile to set up a virtual environment for testing

make

Start the test runner

make test

Metadata

Release files for django-singleactiveobject 0.9.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-singleactiveobject 0.9.1
File Size Uploaded Provenance
django-singleactiveobject-0.9.1.tar.gz 3.8 kB Without provenance Details

Release files / django-singleactiveobject-0.9.1.tar.gz

Download URL django-singleactiveobject-0.9.1.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
037236b59a4e2e9b39807da539e90229e294b6ca72671b8581af334d82ec83cd
BLAKE2b-256 checksum
How to use checksums
f1689232c448374d04fb67a4afe39d5feb7d32c463149b4ead7b64da1c8a5f6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-singleactiveobject 0.9.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.

Release history Release notifications | RSS feed

This release

0.9.1 This release

1 release file 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