Hi,
I was after some opinions on the following use of SA.
1. Is there any problems using SA in this way ?
2. Is there better ways of achieving this ?
My Mapper
db.mapper(Asset, db.asset_table,
properties = {
'location': relation(Location, lazy=False),
'type':
Hi,
I'm using SQLite in tests and there is a problem when using
decimal.Decimal with sqlalchemy's Numeric type:
SQLError: (InterfaceError) Error binding parameter 5 - probably
unsupported type.
This is not a new issue, a similar one was posted in
the thing is, we have support for 6 different databases and postgres
is the *only* one where its DBAPI implementation decides to use
Decimal for numeric types. the rest return just floats. that
means, people who have worked with databases other than postgres will
be totally surprised to
Hi all -
I want to convert a handful of complicated queries into properties,
for simplicity and ease of maintaince.
I currently have a function in my class called 'dependencies':
def dependencies(self):
parent = DataRun.CMDS.alias('PARENT')
return
Hi Ryan,
On Apr 7, 6:10 pm, rkennedy [EMAIL PROTECTED] wrote:
I'm new to SQLAlchemy and am trying to select objects from the
following table that occurred before a specified date.
I'm pretty new myself, but I've been reading the docs a bunch today
and I may be able to help.
event_table =
Ah ok.
Basically, yeah, I'm trying to put all the 'mapper' type behaviors in
one place, instead of having some of the properties specified where I
declare the mapper, and others declared as functions in the class
itself. There might be a better python-esque way of doing this, I
admit, but I
Thanks, Matthew.
Looks like SA is still complaining about the global name not being
defined.
event = self.sess.query(model.Event).get_by(event_table.c.start_time
'2007-10-19 10:23:54')
The above code produces a similar error...
NameError: global name 'event_table' is not defined
When I try
Hi Ryan,
On Apr 7, 8:44 pm, rkennedy [EMAIL PROTECTED] wrote:
Thanks, Matthew.
Looks like SA is still complaining about the global name not being
defined.
event = self.sess.query(model.Event).get_by(event_table.c.start_time
'2007-10-19 10:23:54')
The above code produces a similar
Hi Matthew,
Your assessment was spot on. Apparently the start_time field also
needed an explicit reference to the database table import. The
following query now does the trick...
events =
self.sess.query(model.Event).select_by(model.Event.c.start_time
'2007-10-19 10:23:54')
Thanks again for
On Apr 7, 2007, at 8:19 PM, Benn Bollay wrote:
How about getting a different existing Table object for a table that's
not mapped to a class? I don't want to call Table(...,autoload=True)
again because that sounds like it'd load the entire metadata for the
table each time the function was
FYI the comparisons to a DateTime column are better done against a
similar datetime() object, rather than a string -
select(table.c.date_col datetime.datetime(2007, 10, 19, 10, 23, 54))
On Apr 7, 2007, at 11:44 PM, rkennedy wrote:
Hi Matthew,
Your assessment was spot on. Apparently the
11 matches
Mail list logo