Merge pull request #49 from jjkester/bugfixes

Bugfixes
This commit is contained in:
Jan-Jelle Kester 2016-01-23 22:48:41 +01:00
commit 2b2d572793
5 changed files with 24 additions and 4 deletions

View file

@ -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"

View file

@ -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),
),
]

View 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),
),
]

View file

@ -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"))

View file

@ -22,3 +22,5 @@ DATABASES = {
'NAME': 'auditlog_tests.db',
}
}
ROOT_URLCONF = []