, September 28, 2017 at 10:54:13 AM UTC-4, Mike Bayer wrote:
>
> On Thu, Sep 28, 2017 at 9:29 AM, Doug Farrell <doug.f...@gmail.com
> > wrote:
> > Hi all,
> >
> > I'm having trouble understanding how to use
> > session.begin(subtransactions=True) as a context ma
Hi all,
I'm having trouble understanding how to use
session.begin(subtransactions=True) as a context manager. I'm working in
Python 2.7.5 with SQLAlchemy 1.1.14 in a Flask 0.12.2 application on CentOS
7 servers. I like session.begin() as a context manager, but things aren't
working as I
unsubscribe
--~--~-~--~~~---~--~~
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
Michael,
Congratulations on the release! I look forward to giving it a spin!
Doug
--~--~-~--~~~---~--~~
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
@googlegroups.com
Subject: [sqlalchemy] Re: New instance ExtraStat with identity key
(...) conflicts with persistent instance ExtraStat
I keep thinking one of my relatives has emailed me when you post here
and I get all excited. Any chance you can change your name ? :-)
2008/12/2 Doug Farrell [EMAIL
-to-one since you
cannot have more than one ExtraStat referencing a single Stat, due to
the PK constraint on ExtraStat.name. The error is raising at the point
of query() since autoflush is kicking in - use session.flush() to
isolate the error.
On Nov 29, 2008, at 12:18 PM, Doug Farrell wrote
: New instance ExtraStat with identity key
(...) conflicts with persistent instance ExtraStat
What was your justification of changing the name of my thread to a
completely different topic instead of starting a new thread?
I don't think thats good etiquette.
On Nov 29, 5:22 am, Doug
Hi all,
I'm having a problem with a new instance of a relation conflicting with
an existing instance. I'm using SA 0.5rc with Sqlite3. Here are my
simplified classes:
class Stat(sqladb.Base):
__tablename__ = stats
name = Column(String(32), primary_key=True)
Hi all,
I'm having a problem with a new instance of a relation conflicting with
an existing instance. I'm using SA 0.5rc with Sqlite3. Here are my
simplified classes:
class Stat(sqladb.Base):
__tablename__ = stats
name = Column(String(32), primary_key=True)
total=
Michael,
Thanks for your response. I'll take another look at the ORM tutorial and
the Session chapter now that I've got a little experience and see if
some lights go on.
Your text about deleting instances matches my understanding of how
things work, but it's good to get confirmation and that
.
On Oct 27, 2008, at 9:15 PM, Doug Farrell wrote:
Hi all,
I'm using Python 2.5.1 with SqlAlchemy 0.5rc2 with Sqlite on Windows
Server 2003 and I'm having a problem with my application throwing
InvalidRequestError and ConcurrentModification exceptions. Here is
my
simplified
Hi all,
I'm using Python 2.5.1 with SqlAlchemy 0.5rc2 with Sqlite on Windows
Server 2003 and I'm having a problem with my application throwing
InvalidRequestError and ConcurrentModification exceptions. Here is my
simplified declarative class:
class Job(srsmanagerdb.Base):
STATUS_INIT = 0
Hi all,
I'm using SqlAlchemy 0.5rc1 to track jobs with a sqlite datatabe in a state
machine used by a server. Each job represents a currently active job in the
server and will be alive for awhile as it takes time for the server to
process each job. When a job is done it is removed from the
Hi all,
Well, I'm still stumped by SqlAlchemy syntax, but it's getting better.
I've got some tables built this way using SqlAlchemy 0.5:
press_table = Table('press', metadata, autoload=True)
press_routing_table = Table('press_routing', metadata, autoload=True)
press_routing_press_table
Michael,
You're right of course, your version works fine. I cut and pasted what
you have into my code framework, cleaned up some stuff and it works
there as well. One thing I cleaned up was this:
# initialize the mysql engine and SqlAlchemy base objects
engine =
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: How to perform inner joins
sess.query(Press,
PressRouting.code).join(Press.routes).filter(PressRouting.code=='A').all
()
will return tuples in the form:
(some Press object, somecode)
On Sep 26, 2008, at 3:25 PM, Doug Farrell
@googlegroups.com
Subject: [sqlalchemy] Re: How to perform inner joins
On Sep 26, 2008, at 5:42 PM, Doug Farrell wrote:
I'm have the 'type' column in the press_routing_press linking table;
something like this:
Sess.query(Press,
PressRoutingPress.type).join(Press.routes).filter
Michael,
class PressRoutingPress(Base):
'''This class defines the many-to-many join table between press
and press_routing.
'''
__tablename__ = press_routing_press
__table_args__ = {'autoload' : True}
press_id = Column(Integer, ForeignKey('press.id'),
Hi all,
Well, I'm still stumped by SqlAlchemy syntax, but it's getting better.
I've got some tables built this way using SqlAlchemy 0.5:
press_table = Table('press', metadata, autoload=True)
press_routing_table = Table('press_routing', metadata, autoload=True)
press_routing_press_table =
Hi all,
I'm trying to set up a many-to-many system using the Declarative syntax
against an existing MySQL set of tables. We're using a 'link' table
between two other tables we want to relate many-to-many. Here's the
simplified layout of those tables:
mysql desc press_routing_press;
PM
To: sqlalchemy@googlegroups.com
Subject: [sqlalchemy] Re: ORM mapping existing data tables
On Sep 21, 2008, at 9:09 PM, Doug Farrell wrote:
Hi everyone,
I'm new to SqlAlchemy, but I've got some things working and really
am
enjoying it. Right now I'm trying to ORM map some
Hi everyone,
I'm new to SqlAlchemy, but I've got some things working and really am
enjoying it. Right now I'm trying to ORM map some existing MySQL
database tables to a class. I've read the documentation, I guess I'm
just not getting it. Can someone help me out. I've done this:
# initialize the
Michael,
Thanks for getting back to me so quickly. I've figured out how to get a
one-to-many, single table relationship working with one way relations,
here is that configuration:
class JobData(Base):
__tablename__ = jobs
id = Column(Integer, primary_key=True, autoincrement=True)
23 matches
Mail list logo