Skip to content

Instantly share code, notes, and snippets.

View ishakoktn's full-sized avatar

İshak Okutan ishakoktn

  • Konya, Turkey
View GitHub Profile
@ishakoktn
ishakoktn / log_mixin.py
Last active March 16, 2021 23:40 — forked from Bernix01/log.py
Using LogEntry on Django Rest Framework Viewset
'''
Extracted and modified from django-model-logging
It used it's own LogEntry model but since django
has it's own LogEntry maybe someone would want to
register in the same model instead of creating a
new one.
'''
from django.contrib.admin.models import LogEntry, ADDITION, CHANGE, ContentType, DELETION
from django.utils.translation import gettext as _