Writable Django models layered over read-only, shared source tables — one view, no coalescing at read time.
Project description
django-overlay
A writable Django model layered on top of a read-only table you don't own —
one model to query, no COALESCE/FULL OUTER JOIN at read time.
The problem
You have a big shared read-only table (a vendor import, a third-party dataset) and a small table of tenant edits on top of it. You want one Django model to query, writes landing only in your own table, an edit that copies the row over on first touch, and a foreign key that can still point at it even though Postgres can't put a real FK on a view.
This is OverlayFS applied to Postgres: a writable "upper" table merged with one read-only "lower" table into one "merged" view. Each overlay model has exactly one source table, though which physical table that is can be resolved per tenant — a single, tenant-scoped source, not a union of several.
from django.db import models
from django_overlay.models import OverlayMeta, OverlayModel
from django_overlay.sources import SourceTable
class Person(OverlayModel):
first_name = models.CharField(max_length=100)
class OverlayMeta(OverlayMeta):
@staticmethod
def get_source():
return SourceTable(schema="external_source", table="people")
Person.objects.create(first_name="Jane") # goes straight into the writable table
See docs/INDEX.md for everything else — usage, how it works, ids, uniqueness, deletion, migrations, and running the tests.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_overlay-0.1.0.tar.gz.
File metadata
- Download URL: django_overlay-0.1.0.tar.gz
- Upload date:
- Size: 107.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
498da789935aea3c5cb9525dafb67fb3c06a6c539c27b9424eb4031635b76c75
|
|
| MD5 |
9c8391799eda43ff4e3850ddc3304154
|
|
| BLAKE2b-256 |
5267244e7192993cf62071de22d7249bcf4240f2353faa801c2f6ff0c90c9586
|
Provenance
The following attestation bundles were made for django_overlay-0.1.0.tar.gz:
Publisher:
publish.yml on isik-kaplan/django-overlay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_overlay-0.1.0.tar.gz -
Subject digest:
498da789935aea3c5cb9525dafb67fb3c06a6c539c27b9424eb4031635b76c75 - Sigstore transparency entry: 2255378609
- Sigstore integration time:
-
Permalink:
isik-kaplan/django-overlay@eefc8f472142cc6d4f6ecfd98054289b571c0be7 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/isik-kaplan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eefc8f472142cc6d4f6ecfd98054289b571c0be7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file django_overlay-0.1.0-py3-none-any.whl.
File metadata
- Download URL: django_overlay-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43d8debbb180fe7a7ecab297b1bd6fd392df45a82120c58f9c339faa286a2ab7
|
|
| MD5 |
ddae5e811339f84ee7ac3be9508951f0
|
|
| BLAKE2b-256 |
6c1435ae91a5b8271c01e75921bcdf70e0a6a403b3b81793957ae2178e63be05
|
Provenance
The following attestation bundles were made for django_overlay-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on isik-kaplan/django-overlay
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_overlay-0.1.0-py3-none-any.whl -
Subject digest:
43d8debbb180fe7a7ecab297b1bd6fd392df45a82120c58f9c339faa286a2ab7 - Sigstore transparency entry: 2255378617
- Sigstore integration time:
-
Permalink:
isik-kaplan/django-overlay@eefc8f472142cc6d4f6ecfd98054289b571c0be7 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/isik-kaplan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@eefc8f472142cc6d4f6ecfd98054289b571c0be7 -
Trigger Event:
push
-
Statement type: