[sqlalchemy] and_(condition1,condition2) or condition1 and condition2

2012-01-05 Thread Manav Goel
Hello I noticed that in filter method I can use either and_(condition1,condition2) or condition1 and condition2 But I searched and did not find any mention about second way anywhere. I want to know if both options are equal or there some cat

Re: [sqlalchemy] Modifying a relationship before it gets inserted

2012-01-05 Thread Michael Bayer
On Jan 5, 2012, at 3:03 PM, Mariano Mara wrote: > Hi there! I have a master-detail entity. Since I do some post-processing work > on the details before inserting the entity in the db, I added an > 'after_insert' event where I do the extra stuff. > One of the things I need is to make sure certain

[sqlalchemy] Modifying a relationship before it gets inserted

2012-01-05 Thread Mariano Mara
Hi there! I have a master-detail entity. Since I do some post-processing work on the details before inserting the entity in the db, I added an 'after_insert' event where I do the extra stuff. One of the things I need is to make sure certain "details" have been selected by the user and in case he di

Re: [sqlalchemy] Backref, one to many & many to one.

2012-01-05 Thread Michael Bayer
On Jan 5, 2012, at 9:46 AM, kek06 wrote: > If you are using backref, is there a difference between choosing a > "One to Many" or "Many to One" relationship ? one-to-many and many-to-one are always complementary. think of it as george washington and an eagle on both sides of a quarter. the

Re: [sqlalchemy] Relationship with a parameter?

2012-01-05 Thread Michael Bayer
On Jan 5, 2012, at 9:52 AM, Thijs Engels wrote: > When going through the (excellent) documentation on relationsship I came > across this example: > > > from sqlalchemy import Integer, ForeignKey, String, Column > from sqlalchemy.ext.declarative import declarative_base > from sqlalchemy.orm impo

Re: [sqlalchemy] empty a many-many table

2012-01-05 Thread Michael Bayer
On Jan 5, 2012, at 9:57 AM, Michael Hipp wrote: > Working from the many-many example in the tutorial [1], it has an association > table like this: > > post_keywords = Table('post_keywords', Base.metadata, >Column('post_id', Integer, ForeignKey('posts.id')), >Column('keyword_id', Integer

[sqlalchemy] empty a many-many table

2012-01-05 Thread Michael Hipp
Working from the many-many example in the tutorial [1], it has an association table like this: post_keywords = Table('post_keywords', Base.metadata, Column('post_id', Integer, ForeignKey('posts.id')), Column('keyword_id', Integer, ForeignKey('keywords.id')) ) Normally to just empty ever

[sqlalchemy] Relationship with a parameter?

2012-01-05 Thread Thijs Engels
When going through the (excellent) documentation on relationsship I came across this example: from sqlalchemy import Integer, ForeignKey, String, Column from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship Base = declarative_base() class User(Base):

[sqlalchemy] Backref, one to many & many to one.

2012-01-05 Thread kek06
If you are using backref, is there a difference between choosing a "One to Many" or "Many to One" relationship ? -- 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