Log CUD operations on the course app's models

This commit is contained in:
Zaki Benaissa 2024-01-12 18:19:29 +01:00
parent fbef114a44
commit 61afcc7971
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,21 @@
# Generated by Django 4.0.8 on 2024-01-12 15:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_alter_newsandevents_id_alter_semester_id_and_more'),
]
operations = [
migrations.CreateModel(
name='ActivityLog',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('message', models.TextField()),
('created_at', models.DateTimeField(auto_now=True)),
],
),
]

View File

@ -84,3 +84,11 @@ class Semester(models.Model):
def __str__(self): def __str__(self):
return self.semester return self.semester
class ActivityLog(models.Model):
message = models.TextField()
created_at = models.DateTimeField(auto_now=True)
def __str__(self):
return f"[{self.created_at}]{self.message}"