Thanks Ryne, for the explanation of MIGRATION_MODULES setting.
I've finally dealt with extension migrations and avoided burden of other
apps migrations shipping at the same time.
For a reference, brief info which seems to work with Django 1.8+
1. assign extra model fields in package's *__init__* like mezzanine does
# deferred fields assignment
django.db.models.signals.class_prepared(add_extra_model_fields, weak=
False)
def add_extra_model_fields(sender,**kwargs):
...
field = django.db.models.<field_class>(...)
field.contribute_to_class(<mezzanine_model>,'<field name>')
2. hand-written migration of extension's package
from __future__ import unicode_literals
from django.db import migrations, models
# Trick django migration runs for other application
TARGET_APP = 'shop'
class Migration(migrations.Migration):
# Change to intended application label
def __init__(self, name, app_label):
super(Migration, self).__init__(name, TARGET_APP)
dependencies = [
('shop', '0007_auto_20150921_2323'),
('cartridgex', '0002_productproperties_variation'),
]
# Django would consider this migration as 'squashed'
replaces = (
('shop', '0008_productvariation_tax'),
)
operations = [
migrations.AddField(
...
--
You received this message because you are subscribed to the Google Groups
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.