title: Python Class __init__ Not Working
body: <p>This is some really simple code I am using with sqlalchemy and I am missing something basic here about how classes work.</p>
  
  <pre><code>class Game(Base):
      __tablename__ = "games"
  
      id = Column(Integer, primary_key=True)
      a_name = Column(String)
  
      def __init__(self, **kwargs):
          for k, v in kwargs.iteritems():
               setattr(self, k, v)
          print 'hi'
          self.away_dictionary =  {'name': self.a_name}
  
      @hybrid_property
      def stuff(self):
          return self.away_dictionary
  </code></pre>
  
  <p>The following query works:</p>
  
  <pre><code>session.query(Game).first().a_name
  </code></pre>
  
  <p>but the following query returns an error:</p>
  
  <pre><code>session.query(Game).first().stuff
  'Game' object has no attribute 'away_dictionary'
  </code></pre>
  
  <p>I also have an even more basic problem, when I query the Game class it doesn't print out 'hi'.  So could someone please explain why 'hi' isn't printed out everytime I use a Game instance? And the second question is how can I build and access the away_dictionary I want to have for each instance of this class?</p>