code: def logged_update(self, user, data, *fields):
          
  
          # Get a copy of the frames comparable data before the update
          original = self.comparable
  
          # Update the frame
          _fields = fields
          if len(fields) == 0:
               _fields = data.keys()
  
          for field in _fields:
              if field in data:
                  setattr(self, field, data[field])
  
          self.update(*fields)
  
          # Create an entry and perform a diff
          entry = ChangeLogEntry({
              'type': 'UPDATED',
              'documents': [self],
              'user': user
              })
          entry.add_diff(original, self.comparable)
  
          # Check there's a change to apply/log
          if not entry.is_diff:
              return
          entry.insert()
  
          return entry
docs: Update the document with the dictionary of data provided and log the
          event in the change log.