Skip to main content

A Django application that provides a CompositePKModel, allowing for basic retrieval and saving of models with composite keys.

It is limited to the above tasks, and any use of the model past this is not guaranteed to work.

Example usage

A model with composite PK should look something like this:

from composite_pk import composite

class Lot(composite.CompositePKModel):
    auction = models.ForeignKey(Auction, primary_key=True)
    lot_number = models.IntegerField(primary_key=True)
    objects = composite.CompositePKManager()

So it must:

  • subclass the CompositePKModel,

  • have two or more fields which set the primary_key attribute to True, and

  • use the CompositePKManager as the initial manager.

Metadata

Release files for django-compositepk 1.0

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-compositepk 1.0
File Size Uploaded
django-compositepk-1.0.tar.gz 3.4 kB Details

Release files / django-compositepk-1.0.tar.gz

Download URL django-compositepk-1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
87167e6548d11124c11089cb515b555d2c80290df7c14213e8732e4654dc916a
BLAKE2b-256 checksum
How to use checksums
3f722ba1ac5d793e9904e009488d9fb0a8494a115bedf14a0a2eacc2a804bcb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file

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