docs: def save(self, obj):
          """
          save an object
  
          :param obj: the object
          :return: the saved object
          """
          if obj not in self.session:
              self.session.add(obj)
          else:
              obj = self.session.merge(obj)
          self.session.flush()
          self.session.refresh(obj)
          return obj