<p dir="auto"><strong>Migrated issue, originally created by Anonymous</strong></p>
<p dir="auto">I tried to redefine some of my classes and mappers using the declarative extension in 0.4.5, but I couldn't see how to set the schema argument on the table.  At runtime, schema==None, which won't work for this application.</p>
<p dir="auto">Looking at the code, it appears only "autoload" is honored, and other Table args are ignored.</p>
<p dir="auto">Perhaps we could recognize a <strong>schema</strong> attribute on a declarative class?</p>
<p dir="auto"><strong>Migrated issue, originally created by Michael Bayer (<a href="https://github.com/zzzeek">@zzzeek</a>)</strong></p>
<p dir="auto">consolidating <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384616635" data-permission-text="Title is private" data-url="https://github.com/sqlalchemy/sqlalchemy/issues/1328" data-hovercard-type="issue" data-hovercard-url="/sqlalchemy/sqlalchemy/issues/1328/hovercard" href="https://github.com/sqlalchemy/sqlalchemy/issues/1328">#1328</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384628315" data-permission-text="Title is private" data-url="https://github.com/sqlalchemy/sqlalchemy/issues/2797" data-hovercard-type="issue" data-hovercard-url="/sqlalchemy/sqlalchemy/issues/2797/hovercard" href="https://github.com/sqlalchemy/sqlalchemy/issues/2797">#2797</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="384628720" data-permission-text="Title is private" data-url="https://github.com/sqlalchemy/sqlalchemy/issues/2845" data-hovercard-type="issue" data-hovercard-url="/sqlalchemy/sqlalchemy/issues/2845/hovercard" href="https://github.com/sqlalchemy/sqlalchemy/issues/2845">#2845</a> as these are all dealing with the same thing from different angles.</p>
<p dir="auto">SomeClass.some_m2o, which refers to OtherEntity as a many-to-one, would be interpreted:</p>
<ol dir="auto">
<li>
<p dir="auto">for <code class="notranslate">sess.query(SomeClass.some_m2o)</code> as <code class="notranslate">sess.query(OtherEntity)</code></p>
</li>
<li>
<p dir="auto">for <code class="notranslate">sess.query(SomeClass).filter(SomeClass.some_m2o == OtherEntity)</code> as <code class="notranslate">filter(SomeClass.other_entity_id == OtherEntity.id)</code></p>
</li>
<li>
<p dir="auto">for <code class="notranslate">sess.query(SomeClass).order_by(SomeClass.some_m2o), group_by(SomeClass.some_m2o)</code>, as <code class="notranslate">order_by/group_by SomeClass.other_entity_id</code></p>
</li>
<li>
<p dir="auto">as is currently the case, <code class="notranslate">sess.query(SomeClass).filter(SomeClass.some_m2o == other_entity)</code> compares to other_entity.id</p>
</li>
</ol>
<p dir="auto">any other <code class="notranslate">query.something(SomeClass.m2o..something)</code> type requests should get put here.</p>