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
jablesto 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
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-jables-1.0.tar.gz.
File metadata
- Download URL: django-jables-1.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/3.7.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abf990ff5fbc0091b2f4bff0db91cad0836a447da9b649f18e7ffb9312a22331
|
|
| MD5 |
5f0d2ce03284ae73af7395c9a3a3d568
|
|
| BLAKE2b-256 |
f00047b6c38d363098a39b9eeaf1f2e1ed7117a4daccc2937cf6b0d44092a6c3
|
File details
Details for the file django_jables-1.0-py3-none-any.whl.
File metadata
- Download URL: django_jables-1.0-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/3.7.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ce9482b6bdbaae8f94e387e959989315438a3b850a7522b6978284a97cbac6e
|
|
| MD5 |
f754bd4e04583842dc1abb7187cb45d0
|
|
| BLAKE2b-256 |
7a77fbdc3f6c4f966f31d532f56560fd439193b8b135046d3974c68d0cebb7f7
|