Django model for adding automatic timestamps in models.
Project description
Django Auto Timestamps Model
Django model for automatic timestamps.
Features
- Automatically adds
created_atandupdated_attimestamps to your Django models. - Simplifies tracking of creation and modification times of objects.
Installation
You can install django-auto-timestamps-model via pip:
pip install django-auto-timestamps-model
Usage
- Install django-auto-timestamps-model using pip.
- Import the AutoTimestampsModel class from this module.
- Inherit the AutoTimestampsModel class in your Django model class.
- The 'created_at' and 'updated_at' fields will be automatically added to your model.
- The 'created_at' field will be set to the current timestamp when a new instance is created.
- The 'updated_at' field will be updated with the current timestamp whenever the model is saved.
Example:
from django.db import models
from django_auto_timestamps_model import AutoTimestampsModel
class YourModel(AutoTimestampsModel, models.Model):
# Your model fields here
Compatibility
Django >= 1.4 and Django <= 4.2
Contributing
Contributions are welcome! Please feel free to open an issue or submit a pull request.
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-auto-timestamps-model-1.0.0.tar.gz.
File metadata
- Download URL: django-auto-timestamps-model-1.0.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5dcda3850b0ae878ea9daf00eadcd4fbb7dcba6631fac04dcc0726363123edc
|
|
| MD5 |
120ae4258d1e3ede6f1669b851719bff
|
|
| BLAKE2b-256 |
8b02758d7797661d63546fed9f85b3911014782870eaf2a215df6dbc5b5507fe
|
File details
Details for the file django_auto_timestamps_model-1.0.0-py3-none-any.whl.
File metadata
- Download URL: django_auto_timestamps_model-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2aa3eae85d7f0201ec66b4dd6c24db46f42150b11287d68f2ac8f57921b7293
|
|
| MD5 |
6d36b930dad2b9833fd98b9b2f2ca0d7
|
|
| BLAKE2b-256 |
8f09dde69c727db337c5733f6f2dbff6411c9920dc01b9ebc59970a1f25f1969
|