A
A
Alexander2018-04-26 09:49:03
Django
Alexander, 2018-04-26 09:49:03

How would you log each change to the model fields and its m2m?

A short example of a model:

class MyMolde(models.Model):
    text = models.Text(field)
    user = models.ForeignKey(....User)
    services = models.ManyToMany

That is, you need to log all changes and model bindings . So that the user can later see that the value of this field has been changed from this to this.
Django version 2.0

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Gornostaev, 2018-04-26
@kentuck1213

You just connect django-reversion to the project and get the entire history of creating / changing / deleting models with the ability to roll back to any version and restore the deleted one.

L
latush, 2018-04-26
@latush

What is the base? If MySQL - that triggers in the separate table.
If PostgreSQL - then rules, in a separate table.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question