On Jun 25, 9:53 am, Michael Bayer wrote:
> Beyond that, assuming you're using the ORM, and are ensuring that you fully
> exhaust any row-based result sets that you get from Session.execute(), all
> connections are returned to the pool explicitly without reliance on GC.
Michael, thanks very much
I'm using SQLA in a CherryPy / WSGI--based application running behind
Apache2. The database is hosted on Amazon RDS (MySQL). Recently I've
noticed several errors like this in my logs:
[error] Exception AttributeError: AttributeError("'NoneType' object
has no attribute 'pop'",) in > ignored
I'm us
On May 29, 2:42 pm, Michael Bayer wrote:
> to my knowledge sqlite does not support transactional DDL (seems to have some
> support, but its not fully operational)
Hi, Michael -- and thanks for your quick help. I found a thread that
does seem to indicate that ALTER TABLE should roll back:
http:
I'm trying to do an in-place database "upgrade" -- if I detect that a
column is missing, I use ALTER TABLE to add the column and then
compute values for the new column for each row. I'd like this to all
happen within a transaction, so the column doesn't get added unless
the new values are successf
Another rookie question, and sorry if I've titled it awkwardly. My
User object has a one-to-many relation to an Account object. The
relation is defined with 'accounts = relation("Account")' . As I
understand it, given an instance of User, this lets me easily get to
his accounts with user.accounts;
I have three tables managed by SQLA: 'user' (with a 'username'
column), 'server' (with
'servername' column), and 'account' (with 'password' column and
foreign keys
referring to 'user' and 'server'). The account table basically says
"user X has
an account on server Y with password Z". All are define
On Dec 7, 11:18 am, "Michael Bayer" wrote:
> it seems like you basically want access to the dictionary of type->class.
> You can get this off the base mapper (i.e. class_mapper(BaseClass) ) in a
> dictionary called "polymorphic_map".
Ah, thank you - exactly what I needed. It took me a moment to
I'm using SQLAlchemy's declarative mode with polymorphic
relationships, so I have a base Node class along with several child
classes (ListNode, FileNode, etc.) A polymorphic_identity in the Node
table determines the class of object being loaded (node_type = 'list',
'file', etc.). Each child class
On Nov 24, 3:11 pm, Conor wrote:
> Here is one way you can define your secondary table and ListNode:
>
> class ListNode(Node):
> __mapper_args__ = {'polymorphic_identity': 'list'}
> __tablename__ = 'nodes_list'
>
> id = Column(Integer, ForeignKey('nodes.id'), primary_key=True)
> c
Hi! I've posted this question over on Stack Overflow -- thought
perhaps the mailing list might be a better resource for help. (If
you're a Stack Overflow user and want the points, here's the link:
http://stackoverflow.com/questions/1791713/creating-container-relationship-in-declarative-sqlalchemy
10 matches
Mail list logo