Comments (1)
You are correct, it's not doable out of the box with django-papertrail since Django does not perform change tracking inside the models.
A possible solution would be to try and do something with django-model-util's FieldTracker and a post-save handler that works on models that have the tracker instantiated.
A much less performant solution but without relying on FieldTracker would be to grab the model from the DB in pre_save
(e.g. instance._pre_save_data = instance.__class__.objects.get(pk=instance.pk)
) and then compare against this in post_save
. The problem, obviously, is introducing an extra query to each save as well as race conditions if the model is being accessed and saved from multiple places at the same time.
from django-papertrail.
Related Issues (10)
- Host logo, add to readme HOT 1
- Ensure papertrail works with django-jsonfield 1.0.0 HOT 2
- Switch to using Django's native JSONField for Django>1.9 HOT 1
- Support lookups on objects_represented that aren't PositiveIntegerFields named "id" HOT 3
- django-papertrail requires "target" objects to be registered with Django's ModelAdmin HOT 3
- django-papertrail is not Django 2.0 compatible HOT 1
- Arbitrary instance in `targets`
- Pagination on the object entries page
- `AdminEventLoggerMixin` doesn't work in Django 2.2 project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-papertrail.