Re: [sqlalchemy] Using UniqueConstraint or unique=True :p:

2013-05-06 Thread Paradox
On 05/03/2013 04:18 PM, Simon King wrote: On Thu, May 2, 2013 at 11:43 PM, Paradox para...@pobox.com wrote: CREATE TABLE user (lname string, fname string, email string, unique(lname, fname) ON CONFLICT REPLACE); This will allow me to add multiple rows with the same lname as long as the fnames

[sqlalchemy] Using UniqueConstraint or unique=True

2013-05-02 Thread Paradox
I am trying to ensure that my table doesn't allow duplicate rows. The table is defined (in SqlAlchemy 0.8): class User(Base): __tablename__ = 'user' id = Column(Integer, primary_key=True) lname = Column(String) fname = Column(String) email = Column(String)

Re: [sqlalchemy] Testing sqlalchemy applications :p: :p:

2013-04-25 Thread Paradox
When you say you created a setup fixture but it didn't work, what didn't work exactly? For example, if you just did something like this: def setup(): engine = ... Session = ... session = Session() ...then that won't work because session is a local variable inside the setup

Re: [sqlalchemy] Testing sqlalchemy applications :p:

2013-04-23 Thread Paradox
On 04/23/2013 04:31 PM, Simon King wrote: On Tue, Apr 23, 2013 at 6:54 AM, Paradox para...@pobox.com wrote: I have a question related to sqlalchemy and testing, not sure if this is the best place to ask so let me know if I am asking here in error. I am trying to learn to write and run tests

[sqlalchemy] Testing sqlalchemy applications

2013-04-22 Thread Paradox
I have a question related to sqlalchemy and testing, not sure if this is the best place to ask so let me know if I am asking here in error. I am trying to learn to write and run tests using py.test. Currently I am working on a spreadsheet scrapper that gathers data from a directory tree of