les['a']
> b2 = m2.tables['b']
>
> assert b2.c.y.references(a2.c.x)
> assert not b2.c.y.references(a2.c.z)
>
> On Nov 5, 2011, at 7:30 AM, Michael Bayer wrote:
>
>
>
>
>
>
>
> > can you provide a very simple and pared down test case using table metadata
version 0.7.3.
I have tables with foreign keys defined, and the orm mapping (with
relationships corresponding to the foreign keys) works fine with
autoload=True on the tables.
If I persist the metadata then with pickle, and then reload the app
using pickled metadata and autoload=False, I get the
Yeah SQL 2003 standard says no comma between window specification
details generally,
and postgresql, oracle at least aren't expecting it.
(ansi 2003 draft:)
7.11
...
::=
[ ]
[ ]
[ ]
[ ]
::=
PARTITION BY
...
::=
[ ]
::=
ORDER BY
etc.
On Apr 14, 10:14 pm, botz
Great, thanks for the quick fix.
Found another minor bug with the window functions,
syntax should be
( partition by x order by y)
not
( partition by x, order by y)
... at least for postgresql.
On Apr 14, 8:51 pm, botz wrote:
> Here's a quick example:
>
> the query form i
Here's a quick example:
the query form i'm aiming for is:
select x - lag(x) over ( order by x ) from a;
meta=MetaData()
a = Table('a', meta, Column('x',Integer))
print select([ a.c.x , over( func.lag(a.c.x), order_by =
a.c.x ) ] ) # no problem
print select([ a.c.x - over( func.lag(a.c.x),
wonderful, thanks.
On Mar 23, 3:41 pm, Michael Bayer wrote:
> created ticket 2104 for this which is now fixed.
>
> On Mar 23, 2011, at 4:09 PM, botz wrote:
>
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to
Not sure if pickling of metadata is supported, but between 0.6.6 and
0.7b4 behavior has changed.
The following works under 0.6.6, breaks under 0.7b4 . I've included
the error below.
#!/usr/bin/env python
import pickle
import sqlalchemy
from sqlalchemy import *
from sqlalc
And really if I could just plug in the argument for the foo_props
call, at least in this case it would remove the need for the foreign
key altogether as the join is really handled by the semantics of the
foo_props call, which happens to only return the one related row.
I suppose this could all be
Thanks for that... I didn't manage to get it to work straight off, but
it seems like I'm close.
Tried a couple things just to force it to behave as I wanted.
# defined the selectable
selectable = select( [ sql.column( 'x' ), sql.column('y')],
from_obj =
[ func.foo_
oops, didn't mean to submit that quite yet. crazy dog...
anyways, given that I have foo_props() which acts as a kind of from-
clause
as in
select * from foo_props( 123);
I'd like to use that in relationship to a Foo class
i.e.
mapper( Foo, foo_table, properties( props = relationship( FooProps
Hi,
create type foo_props_type ( foo_id integer, foo_a int , foo_b int );
create function foo_props( foo_id integer ) returns setof
foo_props_type language sql as $$
-- some crazy nested query taking foo_id as param
$$;
class FooProps(object):
pass
--
You received this message because you are
Hi,
create type foo_props_type ( foo_id integer, foo_a int , foo_b int );
create function foo_props( foo_id integer ) returns setof
foo_props_type language sql as $$
-- some crazy nested query taking foo_id as param
$$;
class FooProps(object):
pass
--
You received this message because you are
http://www.sqlalchemy.org/docs/mappers.html#association-object
refers to an Assocation class here:
---
mapper(Parent, left_table, properties={
'children':relationship(Association)
})
mapper(Association, association_table, properties={
'child':relationship(Child)
})
---
but it doesn't se
Hi,
I'm wondering if there's a way I can add a string to the tablename in
a select query without affecting reflection, aliases, etc.
Eg.
given:
t = Table( 'c1', column( 'c1', Integer, primary_key=True)
I'd like to be able to generate:
SELECT scntest.c1 AS scntest_c1 FROM scntest AS OF SCN 123
14 matches
Mail list logo