8000 GitHub - t-evans/django-model-diff: Contains a simple mixin with utility methods for retrieving the differences between two instances of a django Model class.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Contains a simple mixin with utility methods for retrieving the differences between two instances of a django Model class.

Notifications You must be signed in to change notification settings

t-evans/django-model-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Add "django_model_diff" to your INSTALLED_APPS setting.

Example usage:

from django_model_diff.models import ComparableModelMixin
from django.db import models

class MyModel(ComparableModelMixin, models.Model):
    name = models.CharField()

foo_model = MyModel.objects.create(name='foo')
bar_model = MyModel.objects.create(name='bar')

differences_dict = foo_model.find_fields_with_differing_values(bar_model)
name_difference = differences_dict['name']
foo_value = name_difference[0]
bar_value = name_difference[1]

About

Contains a simple mixin with utility methods for retrieving the differences between two instances of a django Model class.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0