[sqlalchemy] Composite foreign key constraints

2010-03-13 Thread sqlalchemy
First of all I realise this question might be more of a design choice question than a technical issue. The issue I am facing is creating a model reflecting a situation where multiple tables all contain data for a particular period. This period consists of both a date and an hour, these two can not

Re: [sqlalchemy] Append column

2010-03-13 Thread Michael Bayer
On Mar 12, 2010, at 10:14 AM, YAD wrote: Hello from sqlalchemy import * engine = create_engine('mysql://root:r...@localhost/sqlalchemy') meta = MetaData(engine) tb = Table('account', meta, autoload = True) tb.append_column(Column('c',String(50))) this code does not work properly, it

Re: [sqlalchemy] Composite foreign key constraints

2010-03-13 Thread Michael Bayer
On Mar 13, 2010, at 7:26 AM, sqlalch...@lists.fastmail.net wrote: class Period(Base): __tablename__ = period id = Column(Integer, primary_key=True) date = Column(Date, nullable=False) hour = Column(SmallInteger, nullable=False) __table_args__ = (

[sqlalchemy] not-null constraint violation in 0.6beta1

2010-03-13 Thread Christoph Ludwig
Hi, I have an application that used to work fine with SQLAlchemy 0.5.6. With 0.6beta1 I observe commit failures when I try to update references in a 1-to-many relationship and delete the then unreferences object. I did not see anything pertinent to this issue in the 0.6 migration guide. The

Re: [sqlalchemy] not-null constraint violation in 0.6beta1

2010-03-13 Thread Michael Bayer
On Mar 13, 2010, at 6:45 PM, Christoph Ludwig wrote: Hi, I have an application that used to work fine with SQLAlchemy 0.5.6. With 0.6beta1 I observe commit failures when I try to update references in a 1-to-many relationship and delete the then unreferences object. I did not see anything

[sqlalchemy] does indexing on database tables have any affect on sqlalchemy mapped classes

2010-03-13 Thread Krishnakant Mane
Hello, This might be a very simple question to answer, but I am not finding any suitable benchmark tests so asking on the mailing list. I want to know if indexing on certain columns impacts the performance of sqlalchemy? for example I am using postgresql with python-psycopg2 and mapping all