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
- Install this package as any other requirement to your project.
- Add
jables
to yourINSTALLED_APPS
. - When creating models, inherit from
JBModel
:
from jables.models import JBModel
class MyModel(JBModel):
...
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
Hashes for django_jables-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ce9482b6bdbaae8f94e387e959989315438a3b850a7522b6978284a97cbac6e |
|
MD5 | f754bd4e04583842dc1abb7187cb45d0 |
|
BLAKE2b-256 | 7a77fbdc3f6c4f966f31d532f56560fd439193b8b135046d3974c68d0cebb7f7 |