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 extension, etc).
On Oct 27, 2006, at 4:40 AM, Alexandre CONRAD wrote: > > 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. > EmailConstraint which would just be a some kind of regex matching on a > given string. > > A la django. > > We could also have custum restrictions based on pre-defined > contraints, > ie. EmailConstraint(contains=["@mycomp.com", "@mycomp.fr"]) > > This would check if the given email is really at a valid email format > and check it also contains either the given strings in the constraint. > > If validation fails, we could catch the Column's name or a list of all > failed Columns at the Table level. > > Regards, > -- > Alexandre CONRAD > > > --~--~---------~--~----~------------~-------~--~----~ 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 this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy -~----------~----~----~----~------~----~------~--~---