[sqlalchemy] Re: relations with additional criteria

2009-10-05 Thread Michael Bayer
Michael Bayer wrote: > > Martijn Faassen wrote: >> >> Hey, >> >> Michael Bayer wrote: >>> Martijn Faassen wrote: Michael Bayer wrote: > subclass RelationProperty fine, but don't get involved with > overriding > its > internal _xxx methods. So: specifically regarding

[sqlalchemy] Clarification on sqlalchemy basics

2009-10-05 Thread Dan06
Over the weekend I started learning/using sqlalchemy. I've put together some practice code that works, however, I don't know if my code is 'correct,' I don't feel like I have a firm grasp of sqlalchemy. Following is my code, it's broken up into 2 (very small) files. I'd appreciate it if the code

[sqlalchemy] Re: relations with additional criteria

2009-10-05 Thread Michael Bayer
Martijn Faassen wrote: > > Hey, > > Michael Bayer wrote: >> Martijn Faassen wrote: >>> Michael Bayer wrote: subclass RelationProperty fine, but don't get involved with overriding its internal _xxx methods. >>> So: >>> >>> Override do_init() completely (not calling the super do_init(

[sqlalchemy] Re: relations with additional criteria

2009-10-05 Thread Michael Bayer
Martijn Faassen wrote: > >> >> the backref you can roll without using backref(). set up your custom >> relation() on the other side and then establish the two-way >> communication >> using the "back_populates" argument on both relations. >> http://www.sqlalchemy.org/trac/browser/sqlalchemy/trunk

[sqlalchemy] Re: relations with additional criteria

2009-10-05 Thread Martijn Faassen
Hey, Michael Bayer wrote: > Martijn Faassen wrote: >> Michael Bayer wrote: >>> subclass RelationProperty fine, but don't get involved with overriding >>> its >>> internal _xxx methods. >> So: >> >> Override do_init() completely (not calling the super do_init()). > > no, call do_init(). > > def

[sqlalchemy] Re: UniqueConstraint with a function

2009-10-05 Thread Joril
In the end I followed the suggestion at http://stackoverflow.com/questions/1510018/compound-uniqueconstraint-with-a-function Many thanks for chiming in all the same :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[sqlalchemy] Re: UniqueConstraint with a function

2009-10-05 Thread maulynvia
I did something like this with class Document(): __module__ = __name__ __tablename__ = 'documents' __table_args__ = (UniqueConstraint('number', 'date'), {} ) id = Column(... ...) But you need to go a step further to link this to year rather than date - perhaps you need to have a

[sqlalchemy] Re: Problem limiting the output of outer join

2009-10-05 Thread maulynvia
That fixed it - thanks so much - I was really stuck on this. I actually removed the col reference and just referred to the table and this was perfect. With the col reference I was getting strange references to 'OL' and '1L' - Merv On Oct 3, 4:10 am, Conor Davis wrote: > tavol wrote: > > I

[sqlalchemy] Re: Strange ObjectDeletedError

2009-10-05 Thread Y3s
On Oct 5, 4:59 am, Michael Bayer wrote: > On Oct 4, 2009, at 7:54 PM, Y3s wrote: > > > Session = orm.sessionmaker(autocommit=True, autoflush=False) > > you're using non-default session settings, all attributes are expired   > upon transaction commit which in this case due to autocommit makes th