On Jun 26, 2012, at 7:59 AM, Iwan Vosloo wrote:
> Hi there,
>
> When we test, we sometimes create temporary classes just for a specific test
> (or group of tests). You might want to inherit from a class that is part of
> production code, for example and override a method for testing purposes,
relationship accepts a "primaryjoin" attribute for this purpose:
http://docs.sqlalchemy.org/en/rel_0_7/orm/relationships.html#specifying-alternate-join-conditions
On Jun 25, 2012, at 7:23 PM, Amos wrote:
> I have a one-to-many relationship from parent to items. In my Parent class I
> define th
you can build your own join construct using @compiles:
# Core Level
from sqlalchemy.sql.expression import Join
from sqlalchemy.ext.compiler import compiles
class StraightJoin(Join):
pass
@compiles(StraightJoin)
def compile(element, compiler, **kw):
return "%s STRAIGHT_JOIN %s ON %s" % (
Hi there,
When we test, we sometimes create temporary classes just for a specific
test (or group of tests). You might want to inherit from a class that is
part of production code, for example and override a method for testing
purposes, etc. When these temporary classes are declarative sqlalche