I actually ended up solving this a different way. The RevisionLog model
classes are required to have a TrackModel field defined, so I made
copy_fields an option defined on the field instead of the model/meta. So I
have something like:
from django.db import models
class TrackModel(models.ForeignKey):
def __init__(self, to, copy_fields, **kwargs):
self.copy_fields = copy_fields
super(TrackModel, self).super(to, **kwargs)
def deconstruct():
name, path, args, kwargs = super(TrackModel, self).deconstruct()
kwargs['copy_fields'] = self.copy_fields
return name, path, args, kwargs
This is actually a nicer api for my use case, doesn't require any
hacks/patches, and the migration autodetector will pick up changes.
Now the only problem I have is trying to figure out how to reference an
implicit m2m through model in a FK field.... Given a m2m field, the through
attribute is apparently abstract and so can't be referenced without
requiring an explicit through model.
--
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 https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/d7ac5773-56a1-453b-b018-04f1a2984bca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.