Metadata-Version: 2.4
Name: django-icv-core
Version: 0.1.0
Summary: Foundation layer for ICV-Django: abstract base models, managers, middleware, utilities, and audit logging.
Author: Nigel Copley
License-Expression: MIT
Project-URL: Homepage, https://github.com/nigelcopley/icv-django
Project-URL: Documentation, https://github.com/nigelcopley/icv-django/tree/main/packages/icv-core
Project-URL: Changelog, https://github.com/nigelcopley/icv-django/tree/main/packages/icv-core/CHANGELOG.md
Project-URL: Issue Tracker, https://github.com/nigelcopley/icv-django/issues
Project-URL: Source Code, https://github.com/nigelcopley/icv-django/tree/main/packages/icv-core
Keywords: django,reusable,base-models,uuid,soft-delete,audit,timestamps
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Django>=4.2
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-django>=4.8; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: factory-boy>=3.3; extra == "dev"
Requires-Dist: ruff>=0.5.0; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Requires-Dist: django-stubs>=5.0; extra == "dev"
Dynamic: license-file

# django-icv-core

[![CI](https://github.com/nigelcopley/icv-django/actions/workflows/ci.yml/badge.svg)](https://github.com/nigelcopley/icv-django/actions/workflows/ci.yml)
[![PyPI version](https://img.shields.io/pypi/v/django-icv-core.svg)](https://pypi.org/project/django-icv-core/)
[![Python versions](https://img.shields.io/pypi/pyversions/django-icv-core.svg)](https://pypi.org/project/django-icv-core/)
[![Django versions](https://img.shields.io/pypi/djversions/django-icv-core.svg)](https://pypi.org/project/django-icv-core/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Foundation layer for ICV-Django packages. Provides abstract base models,
custom managers, middleware, utilities, template tags, and an optional audit
subsystem.

## Installation

```bash
pip install django-icv-core
```

```python
INSTALLED_APPS = [
    # ...
    "icv_core",
]
```

## Documentation

See [APP-001: Core](../../docs/specs/APP-001-core.md) for the full specification.

## Quick Start

```python
from icv_core.models import BaseModel, SoftDeleteModel

class Article(BaseModel):
    title = models.CharField(max_length=255)

class Product(SoftDeleteModel):
    name = models.CharField(max_length=255)

# Soft delete
product.soft_delete()   # sets is_active=False, deleted_at=now
product.restore()       # sets is_active=True, deleted_at=None

# Filtered queries
Product.objects.all()          # active only
Product.objects.deleted()      # soft-deleted only
Product.all_objects.all()      # everything
```

## Settings

All settings use the `ICV_CORE_` prefix. Every setting has a sensible default.

| Setting | Default | Description |
|---------|---------|-------------|
| `ICV_CORE_UUID_VERSION` | `4` | UUID version for primary keys |
| `ICV_CORE_ALLOW_HARD_DELETE` | `False` | Allow `.delete()` on SoftDeleteModel |
| `ICV_CORE_TRACK_CREATED_BY` | `False` | Enable created_by/updated_by tracking |
| `ICV_CORE_AUDIT_ENABLED` | `False` | Enable the audit subsystem |
| `ICV_CORE_AUDIT_RETENTION_DAYS` | `365` | Days before audit entries are eligible for archival |

See [APP-001](../../docs/specs/APP-001-core.md) Section 2 for the full settings reference.
