title: Overriding the table name in Flask-Alchemy
body: <p>I am creating a Flask application and accessing the MySQL database using Flask-Alchemy.</p>
  
  <p>I have following Class to access a table:</p>
  
  <pre><code>class price_table(db.Model):
      id = db.Column(db.Integer, primary_key = True)
      trans_id = db.Column(db.Integer)
      timestamp = db.Column(db.Integer)
      order_type = db.Column(db.String(25))
      price = db.Column(db.Numeric(15,8))
      quantity = db.Column(db.Numeric(25,8))
      def __repr__(self):
              return 'id'
  </code></pre>
  
  <p>For the table 'price_table' this works brilliantly, but problem is I have a few tables with the same columns as 'price_table' from which I only know the name at runtime.</p>
  
  <p>I want to reuse the class above so I thought I could change <strong>tablename</strong> to the name of the table I need to read, but that does not work, the program keeps reading the 'price-table'</p>
  
  <p>How do I override the tablename at runtime?</p>