A simple Django model mixin for timestampable models
Project description
Django Timestampable model is a simple enhancement mixin that enables Django models to have a created_at and updated_at field that is always updated.
The main difference between this plugin and the many others out there that do the same, is that Django Timestampable Models updated the updated_at field under any circumstance: fixture loading, bulk updates, etc. whereas traditional Timestampable mixins only provide shorthand for auto_add and auto_add_now shortcuts for DateTimeField s.
Quick start
Add “django_timestampable” to your INSTALLED_APPS settings like this:
INSTALLED_APPS = [
...
'django_timestampable',
]
Add TimestampableModel in your Model s like so:
class Stuff(TimestampableModel):
some_attribute = CharField()
...
3. Run python manage.py makemigrations then python manage.py migrate to add the columns to your models in your database.
Requirements
No dependencies. Tested on Django 1.9 with Python 2.7.*
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
Hashes for django-timestampable-model-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28345b0b3bf3f5163384931d1576ff774eaeb0311e9d3d23594c1e5d912b3af0 |
|
MD5 | da62ac4887bfa517548a6221af4134d3 |
|
BLAKE2b-256 | 376f11deb6c53615dd0086d16cb24fef769e1501d7eda9669c5876dcf7a287bf |