<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">As it says. (I'm talking about the class-level column attributes that can be used like `.filter(User.name == "bob)" etc.)</p>
<p dir="auto">I suppose there's a logical technical reason for this behaviour, but I think it's still rather unexpected from the perspective of the user. I spent a while tracking down some bugs I was having because of this.</p>
<hr>
<p dir="auto">Attachments: <a href="../wiki/imported_issue_attachments/773/orm_attr_testcase.py">orm_attr_testcase.py</a></p>
<p dir="auto">Hello world,</p>
<p dir="auto">we have a middle sized application that is using SQLAlchemy as the ORM. We started in 2011 with SQLAlchemy 0.6 when the declarative mapping style was still a new feature (and there was <a href="https://pypi.org/project/Elixir/" rel="nofollow">Elixir</a> as an alternative).</p>
<p dir="auto">Today we are still struggling with our mapping configuration. As our data model is mostly hierarchic (a version control system in a database) we have problems with circular dependencies.</p>
<p dir="auto">With declarative this would be a non-issue given forward declarations. Also, IDE support would be much better (currently most column accesses are flagged as error given that the descriptors are added by calling the mapper on the existing class). Finally, to work around some issues we have classes that don't have any ORM related stuff in their home modules but a final <code class="notranslate">foo_bar_mapper.py</code> import attaches the mapper for multiple related classes.</p>
<p dir="auto">This really sucks, therefore there have been multiple attempts to convert our code base to use the declarative extension. Some leaf classes have been converted but the core is still stuck.</p>
<p dir="auto">We tried to go from the base classes downwards or from the leaf classes upward in conversion. But incremental conversion has been unsuccessful.</p>
<p dir="auto">Therefore I would really like some guidance in the SQLAlchemy documentation about how to approach converting a non-simple code base from classical to declarative mapping. Are there any success stories to do this in an incremental way?</p>
<p dir="auto">I'd like to help out here but so far all attempts were a dead end wrt. the hard parts.</p>
<p dir="auto">Thanks and greetings,</p>
<p dir="auto">Torsten</p>