Hi Gavin, On 08/27/2015 07:27 PM, Gavin Wahl wrote: > I'm interested in writing a third-party app that allows users to > declaratively write check constraints and have them automatically be > added and removed by migrations. I'm envisioning being able to attach a > list of Q objects to your model, something like: > > > class Meta: > checks = [ > Q(end_date__isnull=True) | Q(end_date__gt=F('start_date')) > ] > > Now that we have migrations, formalized Meta, and custom lookups, is it > possible for a third-party app to manage this seamlessly? > > I'm having trouble figuring out where it could hook in to migrations to > detect changes to the check constraints, and automatically generate the > migrations with operations to update the constraints. What code I should > be reading to figure out how to do it?
Not to take away from the value of working on making migration-extensions more accessible to third-party code (I think that would be great), but have you considered just doing this work in core? I would guess there'd be strong support from the core team for having a check-constraints feature in Django (I'm certainly in favor). Carl -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/55E07AAB.3090906%40oddbird.net. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: OpenPGP digital signature