title: In SqlAlchemy how to share function between different table ORM
body: <p>I wrote some table ORM in SqlAlchemy, and I want to share common functionality between them, this is my table ORM:</p>
  <pre><code>class RetailCampaignTemp(Base, Serialize, PrimaryField):
      __tablename__ = 'retail_campaign_temp'
      clicks = Column(INTEGER(11))
      id = Column(INTEGER(11), primary_key=True)
  </code></pre>
  <p>Here are my custom functions:</p>
  <pre><code>class Serialize(object):
      def Serialize(self):
          return {c: getattr(self, c) for c in inspect(self).attrs.keys()}
  
  class PrimaryField(object):
  
      @declared_attr
      def GetPrimaryField(cls):
          yield from (column for column in cls.columns if column.primary_key)  
  </code></pre>
  <p>When I call <code>RetailCampaignTemp.GetPrimaryField()</code> it say <code>'generator' object is not callable</code>, what does this mean?</p>