Skip to main content

Provides a base model with rudimentary composite PK abilities.

Project description

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.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-compositepk-1.0.tar.gz (3.4 kB view details)

Uploaded Source

File details

Details for the file django-compositepk-1.0.tar.gz.

File metadata

File hashes

Hashes for django-compositepk-1.0.tar.gz
Algorithm Hash digest
SHA256 87167e6548d11124c11089cb515b555d2c80290df7c14213e8732e4654dc916a
MD5 5d3f00af3b5cafa9240eb04616772fdb
BLAKE2b-256 3f722ba1ac5d793e9904e009488d9fb0a8494a115bedf14a0a2eacc2a804bcb4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page