On Nov 19, 8:14 pm, Michael Bayer mike...@zzzcomputing.com wrote:
The ORM uses attribute set events to flag changes. It then uses the
previous value, if present, to determine if a change has taken place at
flush time, and if so issues an UPDATE. If previous is not present, in
most
With a class with 3 primary key columns, e.g.
class MyClass(Entity):
a = Field(Unicode(64), primary_key=True)
b = Field(Unicode(64), primary_key=True)
c = Field(Unicode(64), primary_key=True)
...
If you pass 4 values to query.get;
MyClass.get(('a_val',
). If so, the
mutability flag should be disabled.
On Nov 4, 2010, at 7:05 AM, Eoghan Murray wrote:
I have the following:
objs =
MyTable.query.options(defer(Table.potentially_very_long_str_column)).all()
for obj in objs:
obj.potentially_very_long_str_column
I have the following:
objs =
MyTable.query.options(defer(Table.potentially_very_long_str_column)).all()
for obj in objs:
obj.potentially_very_long_str_column = ''
At the moment, I'm seeing the assignment in the loop issue the `SELECT
potentially_very_long_str_column`, even
Hi,
I've the following code that works fine in 0.5.8
from sqlalchemy.types import Interval as SAInterval
class Interval(SAInterval):
def process_bind_param(self, value, engine):
coerce to a timedelta
if value is not None:
value =
, i think the contract of TypeDecorator is that you don't need to deal
with super(). But the funny thing about Interval is its already a
TypeDecorator, but the idea should be the same (in 0.5 too...)
Ya, I just had a look at the 0.5.8 docs;
On Jan 3, 2:44 am, Michael Bayer mike...@zzzcomputing.com wrote:
I've made fixes to corresponding_column() to resolve this issue, and
in the process uncovered (and also solved) a whole class of problems
in that method which was, to my great surprise, also impacting some
very nested Query
On Dec 22 2008, 7:10 pm, Eoghan Murray eoghanomur...@gmail.com
wrote:
On Dec 22, 4:16 pm, Gaetan de Menten gdemen...@gmail.com wrote:
I'm not sure what you are trying to do, but MyE.f_1 and MyE.f_2 are
not column objects. f_1_id and f_2_id are.
Sorry, I edited down my example from
On Jan 2, 10:41 pm, Michael Bayer mike...@zzzcomputing.com wrote:
It would help if you could illustrate with accurate code - the UNION
above does not have consistent numbers of columns in each select() and
I think what you're trying to do is reverse f_1 and f_2 in the second
select()
The following example uses an elixir class:
class MyE(Entity):
id = Field(Integer, primary_key=True)
f_1 = ManyToOne('OtherE')
f_2 = ManyToOne('OtherE')
date = Field(Date)
MyE.query.select_from(union(MyE.table.select(),
select([MyE.id,
this:
session.begin()
try:
...
session.flush()
session.commit()
except:
session.rollback()
Eoghan Murray wrote:
Hi,
I've the following which generates an insert:
try:
MyDBLog(
myfield='A too long string '
)
except Exception, e
Hi,
I've the following which generates an insert:
try:
MyDBLog(
myfield='A too long string '
)
except Exception, e:
log.error(Exception occurred with database logging: %s % e)
Unfortunately, 'myfield' is (for example) a string of only length 10,
so the session
Hi,
I'm trying to use mx.TimeDelta instead of datetime.timedelta on an
Interval column (with Postgres).
It seems to work fine until I get to intervals a day, at which point
it fails with:
ProgrammingError: (ProgrammingError) invalid input syntax for type
interval: 1:00:00:00.00
'INSERT INTO
Hi All,
I wish to do an aliased join similar to the last example in the
section http://www.sqlalchemy.org/docs/04/ormtutorial.html#datamapping_joins
session.query(User).\
... join('addresses',
aliased=True).filter(Address.email_address=='[EMAIL PROTECTED]').\
... join('addresses',
On Jan 21, 12:12 am, Michael Bayer [EMAIL PROTECTED] wrote:
On Jan 20, 2008, at 6:52 PM, Eoghan Murray wrote:
Hi All,
I wish to do an aliased join similar to the last example in the
sectionhttp://www.sqlalchemy.org/docs/04/ormtutorial.html#datamapping_joins
session.query(User
On Jan 8, 11:13 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Jan 8, 2008, at 5:40 PM, Eoghan Murray wrote:
On Jan 8, 7:28 pm, Jonathan Gardner [EMAIL PROTECTED]
wrote:
Eoghan Murray wrote:
Ideally this would be expressed as:
MyTable.filter(MyTable.c.MyColumn.in(ls))
Try
Hi All,
I'm wondering if there is a more elegant way to construct the
following piece of SQL:
SELECT * from MyTable where MyTable.MyColumn in ('foo', 'bar', 'baz');
The best I've come up with is the following:
ls = ['foo', 'bar', 'baz']
ls_str = str(ls).replace('[', '(').replace(']',')')
17 matches
Mail list logo