diff --git a/README.md b/README.md index 4712175..05c00f8 100644 --- a/README.md +++ b/README.md @@ -218,11 +218,12 @@ Models should take care of the data model and not much else. ### Base model It's a good idea to define a `BaseModel`, that you can inherit. - -Usually, fields like `created_at` and `updated_at` are perfect candidates to go into a `BaseModel`. - Defining a primary key can also go there. Potential candidate for that is the [`UUIDField`](https://docs.djangoproject.com/en/dev/ref/models/fields/#uuidfield) +At Shahry We're using `TimeStampedModel` which has `created` and `updated` fields + +Since all models should be audit logs the `BaseModel` Should has `AuditLogModel`. + Here's an example `BaseModel`: ```python @@ -230,9 +231,7 @@ from django.db import models from django.utils import timezone -class BaseModel(models.Model): - created_at = models.DateTimeField(db_index=True, default=timezone.now) - updated_at = models.DateTimeField(auto_now=True) +class BaseModel(AuditLogModel, TimeStampedModel): class Meta: abstract = True