-
-
Notifications
You must be signed in to change notification settings - Fork 217
[feature] REST API should store revisions with django-reversion #894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A revision should possibly be created if an object is saved by anything but the admin. https://django-reversion.readthedocs.io/en/latest/api.html#creating-revisions Additionally it might be need to use https://django-reversion.readthedocs.io/en/latest/api.html#registration-api |
@okraits reading the issue again, I think I forgot to specify that I meant to convey that this problem happens when modifying objects via the REST API. |
Hi @nemesifier @pandafy 1. Create another mixin
2. Using Middleware
3. Using Dynamic Patching (Monkey Patching)
4. Centralized Logic in Models
Which Approach to Choose?or there is a better solution for this scenario? Please let me know your thoughts. |
Thanks for proposing multiple solutions @dee077. I checked the documentation of django-reversion and found |
Hi @dee077, @okraits, and @pandafy, We can integrate Notes :
What do you think about this approach? Does it align with the project’s needs, or is there something else we should consider? Looking forward to your feedback! |
I am working on this will make a draft PR soon. |
Implemented three endpoints: 1. List all revisions with optional filtering by model. 2. Inspect a specific revision by its ID. 3. Restore a revision using its ID. Fixes openwisp#894
Implemented three endpoints: 1. List all revisions with optional filtering by model. 2. Inspect a specific revision by its ID. 3. Restore a revision using its ID. Fixes openwisp#894
Implemented three endpoints: 1. List all revisions with optional filtering by model. 2. Inspect a specific revision by its ID. 3. Restore a revision using its ID. Fixes openwisp#894
Implemented three endpoints: 1. List all revisions with optional filtering by model. 2. Inspect a specific revision by its ID. 3. Restore a revision using its ID. Fixes openwisp#894
Implemented three endpoints: 1. List all revisions with optional filtering by model. 2. Inspect a specific revision by its ID. 3. Restore a revision using its ID. Fixes openwisp#894
Uh oh!
There was an error while loading. Please reload this page.
Is your feature request related to a problem? Please describe.
It seems to me that changing objects via the REST API, like devices or templates , which in the admin are monitored via django-reversion, doesn't store revisions.
Therefore if a device is changed via the API, there's no way to rollback changes, nor know who changed the object.
Describe the solution you'd like
Ideally, for each model which supports reversion in the admin, we would need to add equivalent features for the REST API:
Describe alternatives you've considered
There may be third party open source tools we can use, otherwise we can add our own logic in openwisp-utils and start rolling this feature out in the main modules.
The text was updated successfully, but these errors were encountered: