Created
February 10, 2012 16:16
-
-
Save aviars/1790557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save(self, **kwargs): | |
#Create/Update a RESTCAT tx | |
extra_fields = jsonify_extra_fields(self) | |
if not self.idtransaction: | |
from ..tracker.models import idTransaction | |
self.idtransaction=idTransaction.objects.create(subject=self.patient, | |
sender=self.worker, | |
receiver=self.worker, | |
extra_fields=jsonify_extra_fields(self)) | |
super(Linkage, self).save(**kwargs) | |
else: | |
#Check to see if the record has been updated. | |
extra_fields = jsonify_extra_fields(self) | |
if str(self.idtransaction.extra_fields) != str(extra_fields): | |
self.idtransaction.extra_fields = extra_fields | |
self.idtransaction.save() | |
super(GPRAIntakeInterview, self).save(**kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment