-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of bsdemon
Sent: 24 February 2009 20:22
To: sqlalchemy
Subject: [sqlalchemy] Separating session and db/models definitions
Hello.
I have the following states of things:
1) I
Yes, it is really what I need. Thanks! I must read docs more careful.
On Wed, Feb 25, 2009 at 12:40 PM, King Simon-NFHD78
simon.k...@motorola.com wrote:
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of bsdemon
Sent: 24 February
u mean, the Bar is an association table of Foo to Foo?
u have to use secondary_table and/or secondary_join in the relation
setup. And probably specify remote_side or it may not know which Foo
is what.
On Wednesday 25 February 2009 03:39:20 Stef wrote:
Hello Everyone,
First of all, kudos
More info: I have MacOSX and use iODBC with FreeTDS driver.
And looks like everything is OK:
FreeTDS:
[tu...@2kan-2:~/bigur]% tsql -S libra -p 1433 -U user
locale is ru_RU.KOI8-R/UTF-8/ru_RU.KOI8-R/ru_RU.KOI8-R/ru_RU.KOI8-R/
ru_RU.KOI8-R
locale charset is
Password:
1 select * from tax
2 go
sorry its resolved and working
On Feb 25, 12:20 pm, Ash ashishsinghbha...@gmail.com wrote:
Hello ,
I am trying to make query like
select (a+b) from xyz;
to do this
xyz = sqlalchemy.Table('xyz',metadata)
a = sqlalchemy.Column('a', sqlalchemy.Integer)
xyz.append_column(a)
b =
You add the relation to the propoties on mapper.
Look at
http://www.sqlalchemy.org/docs/05/mappers.html#basic-relational-patterns
On Feb 24, 4:10 pm, Marcin Krol mrk...@gmail.com wrote:
Hello everyone,
I've been following
tutorialhttp://www.sqlalchemy.org/docs/05/ormtutorial.htmlwhich
The problem is still their.
The two seprate list of
columns = List of sqlalchem object
operator = ['+'','-']
using join to join them will convert the columns object to string
which is not desirable.
Any way to fix this.
On Feb 25, 3:54 pm, Ashish Bhatia ashishsinghbha...@gmail.com wrote:
Could you use the python 'operator' module
(http://docs.python.org/library/operator.html)?
Eg. (untested):
import operator
operations = {
'+': operator.add,
'-': operator.sub,
# etc.
}
def combine_columns(op, *cols):
return operations[op](*cols)
sum_column =
hi,
how can i filter dynamic relation's query to instances of a given class,
including the subclasses ?
i tried something like
part.documents.filter(Part.documents.of_type(CADDocument))
but i'm getting
ArgumentError: filter() argument must be of type
sqlalchemy.sql.ClauseElement or string
Whoops, premature send, sorry. For an arbitrary list of columns, such as t.c
(the column collection) or other SQL selectables, such as the above binary
expressions, you can use sum(columns). E.g.:
t = Table('bobloblaw', MetaData(), Column('a', Integer), Column('b',
Integer), Column('c', Integer))
Hi,
your suggestion sounds really reasonable but the point is that these
processes are running on different machines and I don't want to put a
lot of effort in synchronizing these threads.
Isn't there any easy solution for having multiple processes working on
the same database table?
Thanks.
thequery().with_polymorphic( list of classes ) ?
On Wednesday 25 February 2009 15:43:54 Vladimir Iliev wrote:
hi,
how can i filter dynamic relation's query to instances of a given
class, including the subclasses ?
i tried something like
How does one create a TypeDecorator to export and import JSON to a
database using SA?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
InvalidRequestError: Query.with_polymorphic() being called on a Query
with existing criterion
a...@svilendobrev.com написа:
thequery().with_polymorphic( list of classes ) ?
On Wednesday 25 February 2009 15:43:54 Vladimir Iliev wrote:
hi,
how can i filter dynamic relation's query to
what happens if you try your stuff without using freeTDS at all ?
lots of problems are reported with FreeTDS and I had my own negative
experience with it recently.
On Feb 25, 2009, at 5:35 AM, Timothy N. Tsvetkov wrote:
More info: I have MacOSX and use iODBC with FreeTDS driver.
And
entirely different machines, then youd have to partition out rows from
the table yourself. you'd select some range of rows using LIMIT/
OFFSET on each machine to be processed. the exact count would depend
on the total rows in the table and the total number of machines.
On Feb 25, 2009,
with_polymorphic() needs to be called first.
On Feb 25, 2009, at 9:54 AM, Vladimir Iliev wrote:
InvalidRequestError: Query.with_polymorphic() being called on a Query
with existing criterion
a...@svilendobrev.com написа:
thequery().with_polymorphic( list of classes ) ?
On Wednesday 25
so it's not possible to reuse relation's query definition ?
Michael Bayer написа:
with_polymorphic() needs to be called first.
On Feb 25, 2009, at 9:54 AM, Vladimir Iliev wrote:
InvalidRequestError: Query.with_polymorphic() being called on a Query
with existing criterion
Hi all,
having a x IN y query, with y supplied as input to the query:
session.query(C).filter(C.someattr.in_(valuelist))
is there a way to tell SQLAlchemy to order the results according to
valuelist? I.e. not by the natural order of someattr, but by the
arbitrary order seen in valuelist?
Is it possible to connect to a server using Windows Authentication
using sqlalchemy?
I have a MSSQL server database where my Windows account is needed to
create tables. I didn’t turn up anything on the connection syntax for
this when I searched.
Thanks in advance.
- Adam
not currently no
On Feb 25, 2009, at 10:46 AM, Vladimir Iliev wrote:
so it's not possible to reuse relation's query definition ?
Michael Bayer написа:
with_polymorphic() needs to be called first.
On Feb 25, 2009, at 9:54 AM, Vladimir Iliev wrote:
InvalidRequestError:
On Wed, Feb 25, 2009 at 11:39, Gregg Lind gregg.l...@gmail.com wrote:
How does one create a TypeDecorator to export and import JSON to a
database using SA?
I did something like that recently:
-
from sqlalchemy import types
import simplejson
class
Thank you, that's simpler than my attempts, for sure!
On Wed, Feb 25, 2009 at 10:27 AM, Roger Demetrescu
roger.demetre...@gmail.com wrote:
On Wed, Feb 25, 2009 at 11:39, Gregg Lind gregg.l...@gmail.com wrote:
How does one create a TypeDecorator to export and import JSON to a
database
so...workaround, use a new query against the target object and call
with_parent(), given the parent object. I didnt realize earlier this
was with a dynamic relation. this is something we should try to
support. with_polymorphic() is tricky since it implies a potential
filtering to be
ok, thanks
Michael Bayer написа:
not currently no
On Feb 25, 2009, at 10:46 AM, Vladimir Iliev wrote:
so it's not possible to reuse relation's query definition ?
Michael Bayer написа:
with_polymorphic() needs to be called first.
On Feb 25, 2009, at 9:54 AM, Vladimir Iliev wrote:
how can i change the type of mapped object using single table inheritance?
thanks
--~--~-~--~~~---~--~~
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
On Wed, Feb 25, 2009 at 13:40, Gregg Lind gregg.l...@gmail.com wrote:
Thank you, that's simpler than my attempts, for sure!
You're welcome.
Note that this implementation is very simple. Depending of your use
case, you probably should take a look at MutableType [1] and
update the type column directly , expunge the old object and then
reload - or use merge() in a similar way if that suits the use case
better. the ORM doesn't support in place type changes currently.
On Feb 25, 2009, at 11:55 AM, Vladimir Iliev wrote:
how can i change the type of mapped
also if you're using single table inheritance, you should be able to
get away without needing with_polymorphic to query on subclasses.
On Feb 25, 2009, at 11:41 AM, Vladimir Iliev wrote:
ok, thanks
Michael Bayer написа:
not currently no
On Feb 25, 2009, at 10:46 AM, Vladimir Iliev
Hello Az,
Yes, Bar is the association table of Foo to Foo. In essence, this is a
self join through a join table.. I have tried and hit my head on this for
(quite literally) hours. In the end, and for the record, I ended up creating
a method on the model itself such as ;
def
check out the association proxy extension if you're looking to have
Bar be hidden as an association object. it will ultimately use
Foo/Bar for querying but attribute access would be proxied through the
names you confgure.
On Feb 25, 2009, at 4:11 PM, Stephen Telford wrote:
Hello Az,
Okay, that sounds like a plan but., not to sound too much like a broken
record, does anyone have an -actual- example ? looking at pages with a lot
of API's is not really going to help me too much :(
This maybe slightly off-topic and it's really NOT meant as flamebait but.. I
remember a while ago
I am doing something similar. The following code works for me in SQLA .4.8
class Foo(Base):
__tablename__ = 'foo'
id = Column(Integer, primary_key=True)
bar_table = Table('bar', Base.metadata,
Column('parent_id', Integer, ForeignKey('foo.id'), nullable=False),
Column('child_id',
Thank you Bobby!! That does make things more easier, and it shows then that
I am being a -real- moron here..
from sqlalchemy import *
from sqlalchemy.orm import sessionmaker, mapper, relation
meta = MetaData()
meta.bind = 'postgres://root:sxta...@192.168.2.198/compass_master'
engine =
and of course, both the passwords -are- the same (duh ;) .. the 'get()'
works fine (obviously ;)
Regards
Stef
On Wed, Feb 25, 2009 at 7:53 PM, Stephen Telford stelford1...@gmail.comwrote:
Thank you Bobby!! That does make things more easier, and it shows then that
I am being a -real- moron
Allen Bierbaum wrote:
On Tue, Feb 24, 2009 at 4:44 AM, Chris Miles miles.ch...@gmail.com wrote:
On Feb 22, 6:08 am, Allen Bierbaum abierb...@gmail.com wrote:
Python 2.5 and later will free up garbage collected memory, handing it
back to the system. Previous versions of Python would never
page 199 of the SQLAlchemy oreilly book talks about association proxy ;)
On Feb 25, 2009, at 6:12 PM, Stephen Telford wrote:
Okay, that sounds like a plan but., not to sound too much like a
broken record, does anyone have an -actual- example ? looking at
pages with a lot of API's is not
I hadn't described the details be there is not much to the work around
and pretty application specific.
The summary is that I moved some application level filtering that was
being done in python code on the results into the query so less
results are returned. This saves a great deal of memory
This works fine
But in the mine case
columns = [a,b,c]
operator = ['+','-']
comes in the list
And it can go to n number.
So while adding it creates a problem
My approach
looping on columns i append it in to the table and hence making the
object
i can join them with operator to form the
This works fine
Thanks for the idea i will try it for the case and get back to here in
the case of problem
On Feb 25, 6:32 pm, King Simon-NFHD78 simon.k...@motorola.com
wrote:
Could you use the python 'operator' module
(http://docs.python.org/library/operator.html)?
Eg. (untested):
import
Hi all,
I have 2 user instance in a session and after I have update one of it
like this
---
u = session.merge(u)
session.commit
session.refresh(u)
The document says:
Expunge removes an object from the Session, sending persistent
instances to the detached state, and pending instances to the
transient state:
I hoped that if an
A little more code to explain:
Before commit, print u2 doesn't do trigger query.
After commit, print u2 trigger a query, even if it has different
primary key with u1.
So this means : when u update one instance, the other instance of the
same type will be in expired state.
43 matches
Mail list logo