code: def restore(self, nosave=False):
          
          if self.exists:
              obj = self.content_type.model_class().objects.get(uid=self.uid)
          else:
              obj = self.content_type.model_class()(uid=self.uid)
          for field in self.fields + self.foreignkeys:
              obj.__setattr__(field, self.get(field))
          if not nosave: obj.save()
          return obj
docs: Restore all of the object attributes to the attributes. Return the
          Django object.