Hello everybody,
I have a question I couldn't find answer on my own so I'll greatly
appreciate if someone could give me an answer.
Considering simple model https://gist.github.com/momyc/7554839, why would
query like the following work:
Thank you Michael for quick response.
On Tuesday, November 19, 2013 8:36:55 PM UTC-4, Michael Bayer wrote:
On Nov 19, 2013, at 7:11 PM, askel dumm...@mail.ru javascript: wrote:
Hello everybody,
I have a question I couldn't find answer on my own so I'll greatly
appreciate if someone could
Askel...
What I'd like to accomplish is to add few more attributes and methods to
Table (or maybe override insert/update/delete/select) to do post
processing of the Result/Row proxies and return them in different formats
such as json, yaml, xml, etc... so, while you suggestion is really
Hello everyone,
I've been using SQLAlchemy for a while and it's been a pleasure. But
sometimes I feel I can get a little more from it or do something more
properly. For instance, imagine two tables with one-to-one relationship
bosth sharing the same primary key and second table containing
There is column_reflect event triggered for each column during table
reflection. Most likely your extra functionality depends on some columns so
I'd look at something like:
from sqlalchemy.event import listens_for
columns_to_reflect = set(('id', 'name', 'real_name',
No offence but it feels like direct route to the hell. Monkeypatching is
acknowledged to be really bad practise in general with few exemptions.
On Thursday, August 1, 2013 9:47:45 AM UTC-4, Simon King wrote:
It's a horrible hack, but did you know that you can change the class
of an instance
Hello everybody,
I've been tearing my hairs out trying to figure out how to achieve the
following.
Base = declarative_base()
class Group(Base):
g_id = Column(Integer, primary_key=True)
events = relationship('Event', backref='group', lazy='dynamic')
class
What I have ended up with is the following:
class Group(Base):
events = relationship('Event', lazy=True)
session.query(Group).join(Group.events).options(contains_eager(Group.events).filter(Event.e_date=='2013-01-01')
The above gives me what I want and does not look crazy. It might be using
AM, askel dumm...@mail.ru javascript: wrote:
What I have ended up with is the following:
class Group(Base):
events = relationship('Event', lazy=True)
session.query(Group).join(Group.events).options(contains_eager(Group.events).filter(Event.e_date=='2013-01-01')
The above gives me what
Looks like I'm experiencing similar problems with InformixDB 2.5 and
SQLAlchemy 0.5.6. Whenever parameters are sent for execution it looks
like integers are used instead of placeholders like ? or :1.
Flollowing are some examples:
2009-10-20 11:12:46,235 INFO
Michael,
I'm sorry for calling you Mike. There is admin Mike that was giving me
hard time all this morning and I have been writing to him alot
recently.
Cheers
Alexander
On Oct 20, 12:18 pm, askel dummy...@mail.ru wrote:
Hi Mike,
create_engine(..., paramstyle='qmark')
has fixed
Hello everybody,
I'm having hard time figuring out how or whether it is possible at all
to use select statement that can access record to be inserted as
column's default value.
groups = Table('groups', meta,
Column('id', Integer, primary_key=True),
Column('prefix', String(32),
Thank you Michael
On May 22, 12:37 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On May 22, 2008, at 12:23 PM, askel wrote:
Hello everybody,
I'm having hard time figuring out how or whether it is possible at all
to use select statement that can access record to be inserted
PROTECTED] wrote:
On May 22, 2008, at 12:23 PM, askel wrote:
Hello everybody,
I'm having hard time figuring out how or whether it is possible at all
to use select statement that can access record to be inserted as
column's default value.
groups = Table('groups', meta,
Column('id
Hello everybody,
I'm wondering if there is a standard way of doing something like the
following:
masters = Table('masters', meta,
Column('id', Integer, primary_key=True),
Column('name', String, unique, nullable=False)
)
details = Table('details', meta,
Column('id', Integer,
Hello everybody,
I was wondering why neither DBAPI nor SA define standard exceptions
like Duplicate key error. It seems to be no portable way to catch
this situations and give user more sensible error messages than just
We are failed to insert a new record. And using exception
information to
trouble than its worth, as far
as it being built-in, default behavior. The number of exception
concepts that are truly portable is relatively low (like duplicate
key), so any such functionality I'd say would have to remain as an
electable.
On Sep 12, 2007, at 11:30 AM, askel wrote:
Hello
.
On Sep 12, 2007, at 11:30 AM, askel wrote:
Hello everybody,
I was wondering why neither DBAPI nor SA define standard exceptions
like Duplicate key error. It seems to be no portable way to catch
this situations and give user more sensible error messages than just
We are failed
Hello everyone!
I'm trying to implement deferred property loading using select():
summaries = select(
[
func.max(transactions.c.processed_at).label('last_used'),
func.count(transactions.c.id).label('times_used'),
],
from_obj=[transactions],
).alias('summaries')
account_mapper =
Michael,
Thank you for answering. The following is what I tried in order to
follow your advise:
account_summaries = select(
[
transactions.c.account_id,
func.max(transactions.c.processed_at).label('last_used'),
func.count(transactions.c.id).label('times_used'),
],
Michael,
transaction.account_id is not a primary key of transactions table. I
added fields I use for grouping to primary_key. Then I had to add
foreign_key argument to 'summary' relation() call. And finally it all
worked as expected.
However, I noticed that it doesn't actually matter which
On May 2, 8:28 pm, Michael Bayer [EMAIL PROTECTED] wrote:
take a look at your SQL output with echo and make sure the queries
make sense. that it works with arbitrary columns as pk/fk could just
be due to particular data youre working with, but you definitely want
to pick a proper candidate
('value', Numeric(12,2), nullable=False,default=prev_balance),
)
On Mar 1, 4:30 pm, Michael Bayer [EMAIL PROTECTED] wrote:
use a python function as your column default ?
http://www.sqlalchemy.org/docs/metadata.myt#metadata_defaults_oninsert
On Feb 28, 6:00 pm, askel [EMAIL PROTECTED] wrote
Michael,
On Mar 1, 8:04 pm, Michael Bayer [EMAIL PROTECTED] wrote:
people ask for this function occasionally, what i dont like about it
is that it would greatly complicate things just to produce
functionality that isnt really needed.
It wasn't my intention to ask anybody to implement such a
Hello everybody,
I have done some initial implementation of Informix as one of SA
backend. It is currently using InformixDB 2.3. I'd like to share what
was already implemented with SA community. Database schema reflection
needs pretty much work. Also, I don't have access to anything but IDS
25 matches
Mail list logo