Skip to main content

Django model for adding automatic timestamps in models.

Project description

Django Auto Timestamps Model

Django model for automatic timestamps.

Features

  • Automatically adds created_at and updated_at timestamps 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

  1. Install django-auto-timestamps-model using pip.
  2. Import the AutoTimestampsModel class from this module.
  3. Inherit the AutoTimestampsModel class in your Django model class.
  4. The 'created_at' and 'updated_at' fields will be automatically added to your model.
  5. The 'created_at' field will be set to the current timestamp when a new instance is created.
  6. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-auto-timestamps-model-1.0.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_auto_timestamps_model-1.0.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file django-auto-timestamps-model-1.0.0.tar.gz.

File metadata

File hashes

Hashes for django-auto-timestamps-model-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a5dcda3850b0ae878ea9daf00eadcd4fbb7dcba6631fac04dcc0726363123edc
MD5 120ae4258d1e3ede6f1669b851719bff
BLAKE2b-256 8b02758d7797661d63546fed9f85b3911014782870eaf2a215df6dbc5b5507fe

See more details on using hashes here.

File details

Details for the file django_auto_timestamps_model-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_auto_timestamps_model-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2aa3eae85d7f0201ec66b4dd6c24db46f42150b11287d68f2ac8f57921b7293
MD5 6d36b930dad2b9833fd98b9b2f2ca0d7
BLAKE2b-256 8f09dde69c727db337c5733f6f2dbff6411c9920dc01b9ebc59970a1f25f1969

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page