code: def new_revision(self, *fields):
          
  
          # Ensure this document is a draft
          if not self._id:
              assert g.get('draft'), \
                      'Only draft documents can be assigned new revisions'
          else:
              with self.draft_context():
                  assert self.count(Q._id == self._id) == 1, \
                          'Only draft documents can be assigned new revisions'
  
          # Set the revision
          if len(fields) > 0:
             fields.append('revision')
  
          self.revision = datetime.now()
  
          # Update the document
          self.upsert(*fields)
docs: Save a new revision of the document