>
> I think if I were doing this, I would go the route of using 
> MIGRATION_MODULES and copying the reusable app's migrations into it, then 
> adding my own migrations. Yes, this would require copying any new 
> migrations from an updated version of the app,
>

Yes that sounds like a  lot of work compared to 3 actual lines of code 
(Yes, the patch is basically 3 lines + property name change where relevant).

but I am a bit nervous about adding more complexity in Django to support 
> other ways of doing it. Too often, these edge case scenarios aren't 
> considered when adding new features or making changes and they 
> inadvertently get broken in some edge cases.
>
 
I'm not sure where the complexity is in this case. It's just adding a 
property to a class, if the property is set, use that as "app to migrate", 
if not just do as usual. All current tests do pass with the patch (there is 
no reason why they shouldn't as _nothing changes_ in the logic of the 
migration process if you don't set the new property), new tests should of 
course be written (which I'm willing to do if this feature gets accepted).
As I said before, this feature should be labeled as dangerous, so I think 
this also means people should find another way if it doesn't work for their 
edge case.


Modifying models in other apps using contribute_to_class() isn't a blessed 
> solution as far as I know, so adding features to support it doesn't feel 
> right to me unless we make that blessing first.
>

contribute_to_class is one of the many  examples, on the top of my head, 
here is another one: email fields in application that support several 
versions of Django but haven't set a fixed length for e-mail fields and yet 
another one is https://github.com/yourlabs/django-cities-light/issues/96 (I 
haven't digged int how this happens, but it does), I'm sure there are many 
more. I've used contribute_to_class in the demo app as it seemed the 
easiest way to replicate a situation where the feature might be useful but 
it's clearly not the only case.

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/66e2c473-41bf-42c3-b03f-5deb1183545b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to