Revert "Merge branch 'version_history_diff'"

This reverts commit 8ee43ef3ab, reversing
changes made to 9964d33cc0.
This commit is contained in:
David Taylor
2016-03-16 14:54:09 +00:00
parent 8ee43ef3ab
commit d8760a00ba
8 changed files with 33 additions and 72 deletions

View File

@@ -17,7 +17,6 @@ from reversion.models import Version
from django.contrib.contenttypes.models import ContentType # Used to lookup the content_type
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.db.models import ForeignKey, IntegerField, EmailField, TextField
from diff_match_patch import diff_match_patch
from RIGS import models, forms
import datetime
@@ -65,25 +64,6 @@ def model_compare(oldObj, newObj, excluded_keys=[]):
return True
return False
@property
def diff(self):
oldText = str(self.display_value(self._old)) or ""
newText = str(self.display_value(self._new)) or ""
dmp = diff_match_patch()
diffs = dmp.diff_main(oldText, newText)
dmp.diff_cleanupSemantic(diffs)
outputDiffs = []
for (op, data) in diffs:
if op == dmp.DIFF_INSERT:
outputDiffs.append({'type':'insert', 'text':data})
elif op == dmp.DIFF_DELETE:
outputDiffs.append({'type':'delete', 'text':data})
elif op == dmp.DIFF_EQUAL:
outputDiffs.append({'type':'equal', 'text':data})
return outputDiffs
changes = []
for thisField in theFields: