From e0dc7099762b3d7133eb55ed16b8c348359cd960 Mon Sep 17 00:00:00 2001 From: Gio Date: Mon, 27 Mar 2023 12:33:11 +0100 Subject: [PATCH] Fixes #250 --- ..._crudevent_easyaudit_c_datetim_a13040_idx.py | 17 +++++++++++++++++ easyaudit/models.py | 4 +++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 easyaudit/migrations/0018_crudevent_easyaudit_c_datetim_a13040_idx.py diff --git a/easyaudit/migrations/0018_crudevent_easyaudit_c_datetim_a13040_idx.py b/easyaudit/migrations/0018_crudevent_easyaudit_c_datetim_a13040_idx.py new file mode 100644 index 0000000..ad5b1a5 --- /dev/null +++ b/easyaudit/migrations/0018_crudevent_easyaudit_c_datetim_a13040_idx.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.7 on 2023-03-27 11:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('easyaudit', '0017_alter_requestevent_datetime'), + ] + + operations = [ + migrations.AddIndex( + model_name='crudevent', + index=models.Index(fields=['-datetime'], name='easyaudit_c_datetim_a13040_idx'), + ), + ] diff --git a/easyaudit/models.py b/easyaudit/models.py index 65b3a3c..1d7ce3d 100644 --- a/easyaudit/models.py +++ b/easyaudit/models.py @@ -58,7 +58,9 @@ class Meta: verbose_name_plural = _('CRUD events') ordering = ['-datetime'] index_together = ['object_id', 'content_type', ] - + indexes = [ + models.Index(fields=['-datetime',]), + ] class LoginEvent(models.Model): LOGIN = 0