mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-05-13 10:03:10 +00:00
commit
2b2d572793
5 changed files with 24 additions and 4 deletions
|
|
@ -5,7 +5,7 @@ python:
|
|||
env:
|
||||
- DJANGO_VERSION=1.7.*
|
||||
- DJANGO_VERSION=1.8.*
|
||||
- DJANGO_VERSION=1.9a1
|
||||
- DJANGO_VERSION=1.9.*
|
||||
install:
|
||||
- "pip install -r requirements.txt"
|
||||
- "pip install Django==$DJANGO_VERSION"
|
||||
|
|
|
|||
|
|
@ -14,6 +14,6 @@ class Migration(migrations.Migration):
|
|||
migrations.AlterField(
|
||||
model_name='logentry',
|
||||
name='object_pk',
|
||||
field=models.TextField(verbose_name='object pk', db_index=True),
|
||||
field=models.CharField(verbose_name='object pk', max_length=256, db_index=True),
|
||||
),
|
||||
]
|
||||
|
|
|
|||
19
src/auditlog/migrations/0007_object_pk_type.py
Normal file
19
src/auditlog/migrations/0007_object_pk_type.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('auditlog', '0006_object_pk_index'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='logentry',
|
||||
name='object_pk',
|
||||
field=models.CharField(verbose_name='object pk', max_length=255, db_index=True),
|
||||
),
|
||||
]
|
||||
|
|
@ -97,7 +97,6 @@ class LogEntryManager(models.Manager):
|
|||
else:
|
||||
return self.filter(content_type=content_type).filter(Q(object_pk__in=primary_keys)).distinct()
|
||||
|
||||
|
||||
def get_for_model(self, model):
|
||||
"""
|
||||
Get log entries for all objects of a specified type.
|
||||
|
|
@ -164,7 +163,7 @@ class LogEntry(models.Model):
|
|||
)
|
||||
|
||||
content_type = models.ForeignKey('contenttypes.ContentType', on_delete=models.CASCADE, related_name='+', verbose_name=_("content type"))
|
||||
object_pk = models.TextField(db_index=True, verbose_name=_("object pk"))
|
||||
object_pk = models.CharField(db_index=True, max_length=255, verbose_name=_("object pk"))
|
||||
object_id = models.BigIntegerField(blank=True, db_index=True, null=True, verbose_name=_("object id"))
|
||||
object_repr = models.TextField(verbose_name=_("object representation"))
|
||||
action = models.PositiveSmallIntegerField(choices=Action.choices, verbose_name=_("action"))
|
||||
|
|
|
|||
|
|
@ -22,3 +22,5 @@ DATABASES = {
|
|||
'NAME': 'auditlog_tests.db',
|
||||
}
|
||||
}
|
||||
|
||||
ROOT_URLCONF = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue