Assuming I define my tables using the following:
CREATE TABLE users (
id SERIAL NOT NULL,
username VARCHAR(255) NOT NULL,
PRIMARY KEY (id),
UNIQUE (username)
)
CREATE TABLE posts (
id SERIAL NOT NULL,
title VARCHAR(255) NOT NULL,
body TEXT NOT NULL,
user_id INTEGER,
PRIMARY KEY (id),
FOREIGN
Mariano, What db? postgres?
On Jul 8, 9:41 am, Mariano Mara mariano.m...@gmail.com wrote:
I'm on a similar situation. For lack of time I couldn't investigate it
yet but I have a drop_all when running nosetests in my pylons project
and it get stuck while dropping the tables. I have to kill the
Jason, in the contrived example I came up with and posted, your
solution worked but not in my tests. I tried both
expires_on_commit=False and Session.remove() before the drop with no
luck. Thanks for the suggestion
On Jul 8, 10:03 am, jason kirtland j...@discorporate.us wrote:
Your scoped
nope. Jason was right :D. I needed to add Session.remove() to my
threads as well; though, I'm not sure why adding
expires_on_commit=False alone didn't solve it. Oh well, works now
Thanks!
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
Base.metadata.drop_all() completely blocks in the tearDown method of
some of my tests. Session is defined with
scoped_session(sessionmaker())
Any ideas how to get around this?
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group,
What's the best way to seed a db with data? I've used
DDL.execute_at('after-create', table) in the past, but is there a way
to get bind.create to run a segment of code first?
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group,
@michael: changed to after_commit
@ivan:
Sorry for the late reply. Here's a decent example. I have this
working in production error free, but it's hardly done. Note, the
code below is a specific example. Let me know if you have questions
from sqlalchemy import orm
def
How do I detach or unload the data from a relation on an instance?
I'm writing a thin layer on top of SA for caching and need to do
serialization. The following happens when serializing:
poet = session.query(Poet).find_by(name='Haafez').one()
pickle.dumps(poet) # Only serializes the Poet
nevermind :(
poet.__dict__.pop('poems')
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to
sqlalchemy+unsubscr...@googlegroups.com.
For
I wrote a simple layer on top of my models that allows them to be
easily inserted into and fetched from memcache. Now, I'm trying to
solve the easier part :) -- cache invalidation. I can use mapper
extensions, but I'm looking for a cleaner way. The biggest problem
with MapperExtension is that
I used SesionExtension.after_flush. Worked great.
Thanks for the help Michael!
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to
11 matches
Mail list logo