title: Get inheriting class name in base class' class method
body: <p>I have Models in my Flask app. I create tables from those models, and insert data into those tables. However, when I insert into those tables I want to log what I am inserting and which table I am inserting into. I have a "create" class method in my BaseModel which all other Models inherit from. I want to log the class name of the inherited Model in this "create" method. When I do so using</p>
  
  <pre><code>cls.__class__.__name__
  </code></pre>
  
  <p>it gives me the value "DefaultMeta". I want it to give me the Model name, for example, User.</p>
  
  <p>Here is my create method in my BaseModel:</p>
  
  <pre><code>class BaseModel(db.Model):
      __abstract__ = True
      __table_args__ = {"extend_existing": True}
  
      id = db.Column(
          db.Integer,
          primary_key=True
          )
      create_date = db.Column(
          db.DateTime,
          default=datetime.utcnow()
          )
      update_date = db.Column(
          db.DateTime,
          default=datetime.utcnow(),
          onupdate=db.func.now()
          )
  
      @classmethod
      def create(cls, **kwargs):
          current_app.logger.info('Creating {} with args: {}'.format(cls.__class__.__name__, kwargs))
          obj = cls(**kwargs)
          db.session.add(obj)
          db.session.commit()
          return obj
  </code></pre>
  
  <p>How can I achieve this? Is it possible?</p>