Reputation: 21
I want to override Django Queryset Update method , to log the model changes in another table.I have override the method , but not able to find the id's of the rows which are going to get update.I am getting the fields which are getting changed from kwargs I'm using Django v1.9.5. I went through the docs of django-simple-history and django-reversion , but they don't log changes on update method.
class PollQuerySet(QuerySet):
def update(self, *args, **kwargs):
# save data into other table whose schema is
#(model_name,field_name,model_pk_id,old_value,new_value)
super().update(*args, **kwargs)
class ModelWithCustomManager(models.Model):
objects = PollQuerySet.as_manager()
class Meta:
abstract = True
Upvotes: 1
Views: 279