vitsin wrote:
hi,
can't figure out why raw SQL works fine, but update() is not working:
1.working raw SQL:
self.session.execute(update public.my_table set
status='L',updated_at=now() where my_name='%s' % (self.my_name))
2.non working update() from Alchemy:
s = aliased(MyTable)
query =
Hello world,
I am tearing my hair about my SQLAlchemy usage in a GUI application,
especially to get it error tolerant.
Usually the GUI filters user inputs before they are thrown at SQLAlchemy
to store it into the database. If that fails, however, it can happen
that data is thrown at the database
I'm trying to get some relationships spanning on multiple tables (4 or
5).
While I got the `4 tables` one working on first attempt (I was
surpized I could...) I can't get the `5 tables` one to work while the
code is almost the same.
Moreover with the first relationship if I add adding
Hi.
I have a problem and am not sure where to begin. I need to construct a
hierarchy tree, something like adjacency_list but in reverse. More
precisely, I need entire branch but only the branch containing given
node ID. In practice, I need this for a product category tree menu which
shows
Daer all
I have a following problem :
Session = sessionmaker(bind=engine)
session = Session()
for item in items:
item1 = session.query(item)
if len(item1)==0:
session.add(item1)
session.commit()
The session is valid for a loop and I write items in a database during
each
On Aug 1, 2011, at 6:25 AM, Torsten Landschoff wrote:
Hello world,
I am tearing my hair about my SQLAlchemy usage in a GUI application,
especially to get it error tolerant.
Usually the GUI filters user inputs before they are thrown at SQLAlchemy
to store it into the database. If that
On Aug 1, 2011, at 11:07 AM, Eduardo wrote:
Daer all
I have a following problem :
Session = sessionmaker(bind=engine)
session = Session()
for item in items:
item1 = session.query(item)
if len(item1)==0:
session.add(item1)
session.commit()
The session is
Hello everyone,
Trying to use hybrid_attribute to provide friendly names for integers
representing object states. Storage and retrieval works fine, but I
can't get filtering working. I want the translation to happen on the
Python side prior to filling in the query parameters, but
'transm_limit': relationship(SurfaceRes, single_parent=True,
#uselist=False,
#primaryjoin=and_(
#user_stratigraphies.c.id_prov==provinces.c.id,
#provinces.c.id_cz==transm_limits.c.id_cz,
#
On Aug 1, 2011, at 5:08 PM, Ross Vandegrift wrote:
Hello everyone,
Trying to use hybrid_attribute to provide friendly names for integers
representing object states. Storage and retrieval works fine, but I
can't get filtering working. I want the translation to happen on the
Python side
On Mon, 2011-08-01 at 17:22 -0400, Michael Bayer wrote:
You're looking to convert from int-string using a mapping in a SQL
expression, so I think you'd need to write @state.expression as a CASE
statement.
from sqlalchemy import case
@state.expression
def state(self):
Hi,
I'm trying to convert a 'simple' many-to-many relationship to an
association object in order to allow the relationship to have
attributes. I've followed the code in examples/association/
proxied_association.py fairly closely (or so I thought) but it isn't
working for me.
As an example, let's
On Aug 1, 2011, at 8:34 PM, somewhatofftheway wrote:
Hi,
I'm trying to convert a 'simple' many-to-many relationship to an
association object in order to allow the relationship to have
attributes. I've followed the code in examples/association/
proxied_association.py fairly closely (or so
You could look for recursive CTE (Common Table Expressions), if your
database engine supports such queries. See e.g.
http://www.postgresql.org/docs/8.4/static/queries-with.html for PostgreSQL.
That allows arbitrary-depth queries, as opposed to join chains that have to
assume a fixed depth. You
14 matches
Mail list logo