Hello
Can i connect to different database with SA.
I want it to connect with SIMPLIFIED CHINESE_CHINA.ZHS16GBK Oracle db.
Is it possible ?
Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I've seen that Session.mapper is deprecated. While I agree that auto-
adding objects to a session may be a bad idea, I don't see why is it
so bad to add the query() method directly to the mapped class.
Is there a reason, why I shouldn't do it?
-Original Message-
From: sqlalchemy@googlegroups.com
[mailto:sqlalch...@googlegroups.com] On Behalf Of naktinis
Sent: 27 July 2009 13:07
To: sqlalchemy
Subject: [sqlalchemy] Session mapper and Class.query() method
I've seen that Session.mapper is deprecated. While I agree that
Hi,
Is there a way in SQLalchemy to have the values of a mapped reflected
table object set to default column values derived from the database
backend?
e.g. if column 'bar' of table 'foo' in my database has a default of
True, I would like to be able to do the following:
foo_table =
Hi, i see that ColumnProperty.columns is a list. I could only produce
examples of ColumnProperties with two values in joins with conflicting
names of attribute from different tables (And SA warns you to use
explicit properties). Are there situation in which it's legitimate to
have more that one
ast wrote:
Hello
Can i connect to different database with SA.
I want it to connect with SIMPLIFIED CHINESE_CHINA.ZHS16GBK Oracle db.
Is it possible ?
as far as I know. nothing special should be needed. you might want to
set NLS_LANG to that value although with current versions of
naktinis wrote:
I've seen that Session.mapper is deprecated. While I agree that auto-
adding objects to a session may be a bad idea, I don't see why is it
so bad to add the query() method directly to the mapped class.
Is there a reason, why I shouldn't do it?
you are free to do it, using a
Jamie Bullock wrote:
Hi,
Is there a way in SQLalchemy to have the values of a mapped reflected
table object set to default column values derived from the database
backend?
e.g. if column 'bar' of table 'foo' in my database has a default of
True, I would like to be able to do the
Carlos Rivolta wrote:
Hi, i see that ColumnProperty.columns is a list. I could only produce
examples of ColumnProperties with two values in joins with conflicting
names of attribute from different tables (And SA warns you to use
explicit properties). Are there situation in which it's
Thanks
/c
--~--~-~--~~~---~--~~
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
Movie is attached to a Director or not. like the FAQ says, we choose
not to get into generating events from foreign keys being set.
which is not a forever rule, but if you look in trac there are about
300 ORM issues open that I'd rather get resolved before I have the
time to
I was able to reproduce this issue in a simple test using sqlite,
submitted as a bug
http://www.sqlalchemy.org/trac/ticket/1485
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this
David Gardner wrote:
I was able to reproduce this issue in a simple test using sqlite,
submitted as a bug
http://www.sqlalchemy.org/trac/ticket/1485
four levels of inheritance ?! hardly simple. turn off the lazy=False for
now, its an eager loading issue.
By simple I mean it isn't based on my schema, and reproducable :)
Michael Bayer wrote:
four levels of inheritance ?! hardly simple. turn off the lazy=False for
now, its an eager loading issue.
--
David Gardner
Pipeline Tools Programmer
Jim Henson Creature Shop
refresh() isnt doing things the same as expire() does. which is not
necessarily wrong, but if you use expire() for now, you'll get better
results. or turn off the lazy=False. but yes its a bug.
David Gardner wrote:
By simple I mean it isn't based on my schema, and reproducable :)
Michael
On 27 Jul 2009, at 16:32, Michael Bayer wrote:
what's elegant to me is:
f = Foo()
Session.add(f)
Session.flush() # or commit
f.bar
True
consider that Foo() wouldn't know about server generated defaults if
not
associated with the database. The database association is achieved
Single table inheritance is broken in the given mapper creating
function on the deprecation guide page. Returning the mapper corrects
the issue.
def session_mapper(scoped_session):
def mapper(cls, *args, **kwargs):
cls.query = scoped_session.query_property()
return
Jamie Bullock wrote:
Only issue now is that if you have a NOT NULL constraint on a field,
an IntegrityError exception gets raised when flush() is called. One
way round this is to supply a dummy value for the field in question.
Is there a better way to prevent the exception?
thats what the
Brad Wells wrote:
Single table inheritance is broken in the given mapper creating
function on the deprecation guide page. Returning the mapper corrects
the issue.
def session_mapper(scoped_session):
def mapper(cls, *args, **kwargs):
cls.query = scoped_session.query_property()
Thanks for looking into this. If it helps you any, this isn't an urgent
problem for me.
It isn't production code that is having this problem, and as you
mentioned I do have
an adequate workaround.
Michael Bayer wrote:
refresh() isnt doing things the same as expire() does. which is not
Hello,
Given hierarchical data similar to:
http://www.sqlalchemy.org/docs/05/mappers.html?#adjacency-list-relationships
With out resorting to brute force recursive queries in my objects:
1) Is there any way to retrieve all a node's children / sub-children?
2) Is there a way to retrieve the
21 matches
Mail list logo