Skip to content

Data Models ​

Development Guidelines ​

TimeStampedModel ​

When creating new models or refactoring existing ones, always inherit from obed.core.models.TimeStampedModel instead of django.db.models.Model.

This ensures consistent tracking of object lifecycle across the application.

Benefits:

  • created_at: Automatically set when the object is first created.
  • updated_at: Automatically updated whenever the object is saved.

Example:

python
from django.db import models
from obed.core.models import TimeStampedModel

class MyNewModel(TimeStampedModel):
    name = models.CharField(max_length=100)
    # created_at and updated_at are included automatically