Thursday, January 28, 2016

proxy model inheritance generates a migration file in a third party app

 
Hello,

I am using a third party app actstream (https://github.com/justquick/django-activity-stream) and am creating a proxy for one of the original actstream models :

# myapp/models.py
from actstream.models import Action
# Subclass Action model and apply my own manager 
class MyAction(Action):
objects = MyActionManager()

class Meta:
proxy = True
app_label = 'actstream'

The issue that I am having is that when I run './manage.py makemigrations', that creates a migration file 0002_myaction.py and adds it to the third party app migrations (instead of adding it to myapp/migrations):

Migrations for 'actstream':

  0002_myaction.py:

    - Create proxy model MyAction


# actstream/migrations/0002_myaction.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('actstream', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='MyAction',
fields=[
],
options={
'proxy': True,
},
bases=('actstream.action',),
),
]
Is there a way to prevent this behavior and force './manage.py makemigrations' to create a migration file in myapp/migrations/ instead? 

Many thanks,
Iliana

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e9d0d1d0-9bf9-435c-b569-32c7a1bb2edb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment