> Some questions/considerations/feedback I would love to see > addressed if they haven't been already (and please don't take > them as a knock against your work...I love the idea of > constraints and I'm pleased to see your work on them):
I was probably asked to post to the Django-users list for such feedback. I am open to suggestions/criticisms because they help you perform better. > 1) are cross-table constraints possible? E.g. > > constraints = ( > ('check_manager', > Check(user__manager__active = True) > ) > ) Haven't thought about this yet....but now its on my todo list. > 2) do they support boolean constructs like the Q() objects do? E.g. > > constraints = ( > ('check_foo', > Check(field__gte=100) | Check(field__lte=42) > ) > ) This is supported. > constraints = ( > ('check_foo', > Check(Q(field__gte=100) | Q(field__lte=42)) > ) > ) This too I haven't thought of....studying this feasibility. > 3) namespacing for the constraints to prevent naming clashes? > using your example, if a second model also has a check with a > constraint named "check_name", the generated code will try to > create to constraints with the same name. I don't know if this > is a problem in all DBs, but IIRC, at least PostgreSQL will > kvetch at the condition. Perhaps prefixing the constraint-name > with the table name would solve the problem? > > CREATE TABLE "appname_manufacturerer" ( > ... > CONSTRAINT "appname_manufacturer__check_name" > CHECK ("mfg_name" like 'Merc%%'), > ... > ); One more item in my todo list now. > 4) do the constraints get dropped properly when doing a DB purge > (using "manage.py sqlclear" or "manage.py sqlreset")? Yes they do get dropped cleanly. Thanks for the feedback. Cheers Thejaswi Puthraya --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---