mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
Apply isort to the code base
This commit is contained in:
parent
49d92b30fe
commit
4232d685bd
15 changed files with 45 additions and 45 deletions
|
|
@ -4,14 +4,14 @@ from django.core.paginator import Paginator
|
|||
from django.utils.functional import cached_property
|
||||
|
||||
from auditlog.count import limit_query_time
|
||||
from auditlog.models import LogEntry
|
||||
from auditlog.mixins import LogEntryAdminMixin
|
||||
from auditlog.filters import (
|
||||
ShortActorFilter,
|
||||
ResourceTypeFilter,
|
||||
FieldFilter,
|
||||
ResourceTypeFilter,
|
||||
ShortActorFilter,
|
||||
get_timestamp_filter,
|
||||
)
|
||||
from auditlog.mixins import LogEntryAdminMixin
|
||||
from auditlog.models import LogEntry
|
||||
|
||||
|
||||
class TimeLimitedPaginator(Paginator):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import contextlib
|
||||
from functools import partial
|
||||
import time
|
||||
import threading
|
||||
import time
|
||||
from functools import partial
|
||||
|
||||
from django.contrib.auth import get_user_model
|
||||
from django.db.models.signals import pre_save
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from django.db import connection, transaction, OperationalError
|
||||
from django.db import OperationalError, connection, transaction
|
||||
|
||||
|
||||
def limit_query_time(timeout, default=None):
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from django.conf import settings
|
||||
from django.core.exceptions import ObjectDoesNotExist
|
||||
from django.db.models import Model, NOT_PROVIDED, DateTimeField
|
||||
from django.db.models import NOT_PROVIDED, DateTimeField, Model
|
||||
from django.utils import timezone
|
||||
from django.utils.encoding import smart_str
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from django.contrib.contenttypes.models import ContentType
|
|||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import connection
|
||||
from django.db.models import Value
|
||||
from django.db.models.functions import Concat, Cast
|
||||
from django.db.models.functions import Cast, Concat
|
||||
|
||||
from auditlog.registry import auditlog
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from django.db import models, migrations
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from django.db import migrations
|
||||
import jsonfield.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from django.db import migrations
|
||||
import jsonfield.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ from django.conf import settings
|
|||
from django.contrib.contenttypes.fields import GenericRelation
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import FieldDoesNotExist
|
||||
from django.db import models, DEFAULT_DB_ALIAS
|
||||
from django.db.models import QuerySet, Q
|
||||
from django.db import DEFAULT_DB_ALIAS, models
|
||||
from django.db.models import Q, QuerySet
|
||||
from django.utils import formats, timezone
|
||||
from django.utils.encoding import smart_str
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
from typing import Dict, Callable, Optional, List, Tuple
|
||||
from typing import Callable, Dict, List, Optional, Tuple
|
||||
|
||||
from django.db.models import Model
|
||||
from django.db.models.base import ModelBase
|
||||
from django.db.models.signals import pre_save, post_save, post_delete, ModelSignal
|
||||
from django.db.models.signals import ModelSignal, post_delete, post_save, pre_save
|
||||
|
||||
DispatchUID = Tuple[int, str, int]
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ class AuditlogModelRegistry(object):
|
|||
delete: bool = True,
|
||||
custom: Optional[Dict[ModelSignal, Callable]] = None,
|
||||
):
|
||||
from auditlog.receivers import log_create, log_update, log_delete
|
||||
from auditlog.receivers import log_create, log_delete, log_update
|
||||
|
||||
self._registry = {}
|
||||
self._signals = {}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@ import uuid
|
|||
|
||||
from django.contrib.postgres.fields import ArrayField
|
||||
from django.db import models
|
||||
from multiselectfield import MultiSelectField
|
||||
|
||||
from auditlog.models import AuditlogHistoryField
|
||||
from auditlog.registry import auditlog
|
||||
|
||||
from multiselectfield import MultiSelectField
|
||||
|
||||
|
||||
@auditlog.register()
|
||||
class SimpleModel(models.Model):
|
||||
|
|
|
|||
|
|
@ -1,32 +1,33 @@
|
|||
import datetime
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User, AnonymousUser
|
||||
from django.db.models.signals import pre_save
|
||||
from django.test import TestCase, RequestFactory
|
||||
from django.utils import dateformat, formats, timezone
|
||||
from dateutil.tz import gettz
|
||||
|
||||
import mock
|
||||
from auditlog_tests.models import (
|
||||
AdditionalDataIncludedModel,
|
||||
AltPrimaryKeyModel,
|
||||
CharfieldTextfieldModel,
|
||||
ChoicesFieldModel,
|
||||
DateTimeFieldModel,
|
||||
ManyRelatedModel,
|
||||
NoDeleteHistoryModel,
|
||||
PostgresArrayFieldModel,
|
||||
ProxyModel,
|
||||
RelatedModel,
|
||||
SimpleExcludeModel,
|
||||
SimpleIncludeModel,
|
||||
SimpleMappingModel,
|
||||
SimpleModel,
|
||||
UUIDPrimaryKeyModel,
|
||||
)
|
||||
from dateutil.tz import gettz
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import AnonymousUser, User
|
||||
from django.db.models.signals import pre_save
|
||||
from django.test import RequestFactory, TestCase
|
||||
from django.utils import dateformat, formats, timezone
|
||||
|
||||
from auditlog.middleware import AuditlogMiddleware
|
||||
from auditlog.models import LogEntry
|
||||
from auditlog.registry import auditlog
|
||||
from auditlog_tests.models import (
|
||||
SimpleModel,
|
||||
AltPrimaryKeyModel,
|
||||
UUIDPrimaryKeyModel,
|
||||
ProxyModel,
|
||||
SimpleIncludeModel,
|
||||
SimpleExcludeModel,
|
||||
SimpleMappingModel,
|
||||
RelatedModel,
|
||||
ManyRelatedModel,
|
||||
AdditionalDataIncludedModel,
|
||||
DateTimeFieldModel,
|
||||
ChoicesFieldModel,
|
||||
CharfieldTextfieldModel,
|
||||
PostgresArrayFieldModel,
|
||||
NoDeleteHistoryModel,
|
||||
)
|
||||
|
||||
|
||||
class SimpleModelTest(TestCase):
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
from django.conf.urls import url
|
||||
from django.contrib import admin
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^admin/", admin.site.urls),
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue