That did the trick.
Thanks a lot.
Your solution uses the orm sessionmaker. Till now my script was relying on
sqlalchemy's expression
language. Is there some way of doing the same with the expression language?
Or would it get too
complicated? (Just curious)
Cheers,
T
On Mon, Sep 14, 2009 at
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of C.T. Matsumoto
Sent: 15 September 2009 07:21
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: getting data from primary keys
That did the trick.
Thanks a lot.
', 'clerk')
jack = Employee('Jack', 'manager')
m1 = Meeting('20090914', peter, john)
m2 = Meeting('20090915', peter, jack)
s.add_all([john, peter, jack, m1, m2])
s.commit()
#We now want to print the names and positions of everyonePeter has
ever met
When mapping an arbitrary selectable, does mapper's primary_key argument
need to be a primary key in the base table?
Using 0.5.6, but I seem to remember same behavior in earlier versions.
This works and does not generate any errors:
t1 = Table('t1', meta, Column('foo', Integer,
)()
john = Employee('John', 'person')
peter = Employee('Peter', 'clerk')
jack = Employee('Jack', 'manager')
m1 = Meeting('20090914', peter, john)
m2 = Meeting('20090915', peter, jack)
s.add_all([john, peter, jack, m1, m2])
s.commit()
#We now want to print
Mike Conley wrote:
When mapping an arbitrary selectable, does mapper's primary_key argument
need to be a primary key in the base table?
Using 0.5.6, but I seem to remember same behavior in earlier versions.
This works and does not generate any errors:
t1 = Table('t1', meta, Column('foo',
Hey everyone,
sorry for the title, I couldnt think of any way to describe this in
short.
I have 3 Classes, which have basically this relationship:
1 Class1 has n Class2 ( 1:n)
1 Class2 has n Class3 ( 1:n)
So basically it looks like this:
Class1
|-- Class2
|-- Class3
Now if I
On Sep 15, 5:38 am, Crusty crust...@gmail.com wrote:
Hey everyone,
sorry for the title, I couldnt think of any way to describe this in
short.
I have 3 Classes, which have basically this relationship:
1 Class1 has n Class2 ( 1:n)
1 Class2 has n Class3 ( 1:n)
So basically it looks like
Submitted ticket #1542
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to
On Thu, Sep 10, 2009 at 23:27 +0200, Wolodja Wentland wrote:
Hi all,
I observed that if I define a relation (foo_query) as lazy='dynamic' and
access all referenced entities with foo_query.all() that the query will
be executed every time i access it. That is not a big surprise ;-)
In a
Keep in mind that the method on your Bar class:
def all_foo(self):
foo_query.all()
will return a raw *list* of Foo objects. If you append more Foo
objects to it, they won't be seen by SQLAlchemy's session, thus not
being commited. Although, if you have set on your mapper:
2009/9/10 Wolodja Wentland wentl...@cl.uni-heidelberg.de:
Class Bar(object):
def all_foo(self):
foo_query.all()
def foo_startwith(self, search_string):
foo.query.filter(tbl.c.col.like('%s%%'% ...))
Note that a .startswith() method is already implemented in SA:
I'm trying to delete in bulk using query(). query() seems to work
fine:
(Pdb) Session.query(TreeNode).filter(TreeNode.guid.in_
(deadNodeGuids)).all()
[lajolla.main.tree.TreeNode object at 0x81c82c8c,
lajolla.main.tree.TreeNode object at 0x81c8220c]
But delete() is not happy:
(Pdb)
Yes, I want to map to a join between two classes which are parts of
joined table inheritance. I don't think it's complex - it fits very
naturally with the problem I am modeling.
When I said it's efficient, I meant that the generated SQL is optimal,
ie. the same as I would write if I were doing
bojanb wrote:
Yes, I want to map to a join between two classes which are parts of
joined table inheritance. I don't think it's complex - it fits very
naturally with the problem I am modeling.
When I said it's efficient, I meant that the generated SQL is optimal,
ie. the same as I would
What I think I'm seeing is that an object can be created even without it's
ForeignKeyConstraint being filled.
To run the test code below:
$ dropdb test18; createdb test18; python testcode.py
This builds on
http://groups.google.com/group/sqlalchemy/browse_thread/thread/eb240f3f2555a5e7/
.
I
The following code models a simple system that tracks the transfer of
construction tools between jobs. Equip (equipment) is transferred
between Jobs via Shipments.
Towards the end I attempt to map a class to a select statement in
order to make reporting simple. Instead of dealing with sql to
Gregg Lind wrote:
What I think I'm seeing is that an object can be created even without it's
ForeignKeyConstraint being filled.
To run the test code below:
$ dropdb test18; createdb test18; python testcode.py
on is not defined:
ForeignKeyConstraint(['regstring_id',
On Sep 15, 4:08 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Gregg Lind wrote:
What I think I'm seeing is that an object can be created even without it's
ForeignKeyConstraint being filled.
To run the test code below:
$ dropdb test18; createdb test18; python testcode.py
on is not
Thank you both for the advice. Dern NULLs causing trouble again.
GL
On Tue, Sep 15, 2009 at 4:34 PM, Conor conor.edward.da...@gmail.com wrote:
On Sep 15, 4:08 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Gregg Lind wrote:
What I think I'm seeing is that an object can be created
There is a Sphinx module called intersphinx that allows API docs to be
cross referenced between sites. To make it work you have to upload
the objects.inv file to you web server so that when someone generates
their own Sphinx-based docs it knows how to reference the remote docs.
Does SQLAlchemy
Brett wrote:
There is a Sphinx module called intersphinx that allows API docs to be
cross referenced between sites. To make it work you have to upload
the objects.inv file to you web server so that when someone generates
their own Sphinx-based docs it knows how to reference the remote docs.
Sorry, I had put a . in 05
On Sep 15, 4:22 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Brett wrote:
There is a Sphinx module called intersphinx that allows API docs to be
cross referenced between sites. To make it work you have to upload
the objects.inv file to you web server so
Hi All
I've been reading the documentation for ages and i can't figure out
why when i print the results a query from my inherited table, It just
prints them as the base type.
I was hoping someone here would be nice enough to help me solve this
problem.
I thought the last print statement would
thanks for the (insanely fast) help! wanted to avoid doing something
unnecessarily odd.
i ended up wrapping the relation in an object proxy when passing it to
the join. the proxy ANDs additional criterion into the primary or
secondary join attributes of the relation based on what is supplied
Thanks for the help!
T
On Tue, Sep 15, 2009 at 12:33 PM, King Simon-NFHD78 simon.k...@motorola.com
wrote:
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of C.T. Matsumoto
Sent: 15 September 2009 07:21
To:
26 matches
Mail list logo