title: SQLAlchemy mapping class relationship error
body: <p>I am facing this InvalidRequestError that my relationships between two classes are not mapped properly. This is one(Question) to Many(Choice) relationship.</p>
  <pre><code>from sqlalchemy.ext.declarative import declartive_base
  Base = declarative_base()
  
  class ChoiceModel(Base):
    __tablename__ = 'choice'
    id_seq = Sequence('choice_id_seq', metadata=Base.metadata)
    id = Column(Integer, id_seq, server_default=id_seq.next_value(), primary_key=True, index=True)
    choice_context = Column(Text, nullable=False)
    question_id = Column(Integer, ForeignKey('question.id'))
    question = relationship('QuestionModel', back_populates='choices')
  
  class QuestionModel(Base):
    __tablename__ = 'question'
     id_seq = Sequence('question_id_seq', metadata=Base.metadata)
     id = Column(Integer, id_seq, server_default=id_seq.next_value(), primary_key=True, index=True)
     correct = Column(Boolean, nullable=False)
     choice_list = Column(ARRAY(Integer))
  
     choices = relationship(&quot;ChoiceModel&quot;, back_populates='question', cascade=&quot;all, delete-orphan&quot;)
  </code></pre>
  <p>And the error I am getting,</p>
  <pre><code>sqlalchemy.exc.InvalidRequestError: 
  When initializing mapper mapped class ChoiceModel-&gt;choice, 
  expression 'Question' failed to locate a name ('Question'). 
  If this is a class name, consider adding this relationship() to the 
  &lt;class 'project.core.models.choice_model.ChoiceModel'&gt; class after both dependent classes have been defined.
  </code></pre>
  <p>I have read SQLAlchemy official <a href="https://docs.sqlalchemy.org/en/14/orm/basic_relationships.html#one-to-many" rel="nofollow noreferrer">document</a> similar questions in stackoverflow that most of them used wrong class name, or didn't have <code>back_populates</code>. <br/>
  My questions are,<br/>
  should I have to change my classes name, like <code>Choice</code>, <code>Question</code> instead of having postfix <code>Model</code> ?<br/>?
  If I mapped correctly, what causes this error?<br/>
  I have set my PostgreSQL tables name, <code>choice</code> and <code>question</code></p>
  <p>*python==3.10<br/>
  *ubuntu==20.04<br/>
  *fastapi==0.73.0<br/>
  *SQLAlchemy==1.4.31<br/>
  *postgresql==14.2<br/></p>
  <p>Thanks in advance!</p>