[sqlalchemy] CheckConstraint

2006-10-27 Thread Alexandre CONRAD
Hello, I was reading about the CheckConstraint documentation, and it looks promising. The examples in the docs are doing contraint with integers. But the cool thing would be able to define you're own contrainsts using ConstraintTypes, or already have pre-defined constraints, ie.

[sqlalchemy] Re: CheckConstraint

2006-10-27 Thread Michael Bayer
you mean a python-level constraint. id definitely build this as just a callable that takes the whole insert/update criterion and just returns true or false. all the django-niceties are frameworkisms (which folks are free to build, put on the wiki, provide a handy module full of as an

[sqlalchemy] Re: related object list not being updated on delete

2006-10-27 Thread Hogarty, David A.
Thanks, I got it working. For future reference, if you have a polymorphic relationship, in order to avoid this kind of phantom object, you need to manually delete from both the parent collection and the child collection, e.g. Project (Has Many)- Node Parameter (Subclass)- Node to remove a

[sqlalchemy] Re: CheckConstraint

2006-10-27 Thread Jorge Vargas
why not just include formencode support? On 10/27/06, Michael Bayer [EMAIL PROTECTED] wrote: you mean a python-level constraint. id definitely build this as just a callable that takes the whole insert/update criterion and just returns true or false. all the django-niceties are

[sqlalchemy] Re: SQLAlchemy + RPC

2006-10-27 Thread David Siroky
Thanks. I solved it by exposing connection and cursor objects via a Pyro. I don't have any access control for individual rows in tables but it doesn't matter for now. But I have a different problem now. I have a simple pool on the server side where I'm storing connections and cursors and it is

[sqlalchemy] Re: SQLAlchemy + RPC

2006-10-27 Thread iGL
Hi, the engine connections are actually destroyed by garbage collections. This should happen as soon as the object is not referred anymore; thus, one must explicitly close any connection. It's stated so here: http://www.sqlalchemy.org/docs/dbengine.myt#dbengine_connections - SA 0.3 as well as

[sqlalchemy] Re: related object list not being updated on delete

2006-10-27 Thread Hogarty, David A.
That might be worth doing... the example I gave of deleting from both lists seems to fail erratically based on when and how the lists were referenced before removal. For example, the following: def test_node_polymorphism(self): p = Project(name='p') db.session.save(p) p.nodes

[sqlalchemy] Re: Simple question: getting backend type from engine

2006-10-27 Thread Michael Bayer
oh sorry, do this: engine.name has names that match the somedb:// part of the url. On Oct 27, 2006, at 2:58 PM, [EMAIL PROTECTED] wrote: This mail I sent some days ago was unanswered, I guess the answer should be pretty simple thought TIA sandro Hi, which is the correct way to

[sqlalchemy] Re: related object list not being updated on delete

2006-10-27 Thread Michael Bayer
OK yeah, the relation() idea is not nearly smart enough to figure out what you mean there, or to even support overlapping collections (i.e. if you didnt have nodes, it could work with just algorithms and parameters). the two extra relations could be implemented with a custom join

[sqlalchemy] Re: related object list not being updated on delete

2006-10-27 Thread Hogarty, David A.
Cool, that should be fine for my current application, thanks =) -Dave -Original Message- From: sqlalchemy@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Michael Bayer Sent: Friday, October 27, 2006 3:32 PM To: sqlalchemy@googlegroups.com Subject: [sqlalchemy] Re: related object