Skip to main content

A better base model for Django with sensible defaults.

Project description

Jean-Baptiste, aka Jables

This package contains a single useful base model I was copying over and over onto every new project. It was time to package it up and reuse it.

This is a basic model from which all the project's model should inherit. It is defined as "abstract".

It defines a couple of basic fields every model should have:

  • an ID as CharField/NanoID: this avoids that content could be "discovered" if using auto increment and instead is a better UUID

  • created_at: a datetime field with "auto_now_add", so we track when the model was created.

  • updated_at: a datetime field with "auto_now", so we track when the model was last updated.

The name comes from Django Reinhart father, Jean-Baptiste (or Jables, for short).

How to use it

  1. Install this package as any other requirement to your project.
  2. Add jables to your INSTALLED_APPS.
  3. When creating models, inherit from JBModel:
from jables.models import JBModel

class MyModel(JBModel):
    ...

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-jables-1.0.tar.gz (15.1 kB view hashes)

Uploaded Source

Built Distribution

django_jables-1.0-py3-none-any.whl (15.5 kB view hashes)

Uploaded Python 3

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