Log CUD operations on the course app's models
This commit is contained in:
parent
fbef114a44
commit
61afcc7971
21
core/migrations/0005_activitylog.py
Normal file
21
core/migrations/0005_activitylog.py
Normal 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)),
|
||||
],
|
||||
),
|
||||
]
|
||||
@ -84,3 +84,11 @@ class Semester(models.Model):
|
||||
|
||||
def __str__(self):
|
||||
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}"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user