Arun SS
Arun SS

Reputation: 1911

django oscar model customization : model change is not reflected while makemigrations

I am trying to customize Products and few other models in the catalogue app following the documentation.

I have forked catalogue app (to myproject/boscar/catalogue) as per documentation documentation and my updated boscar/catalogue/models.py:

from django.db import models
from oscar.apps.catalogue.abstract_models import AbstractProduct

class Product(AbstractProduct):
    is_active = models.BooleanField(default=False)

from oscar.apps.catalogue.models import *

I have already included the modified catalogue app, in the INSTALLED_APPS in settings.py as an argument for get_core_apps function.

    INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rest_framework',
    'django.contrib.sites',
    'django.contrib.flatpages',
    'bmigrate',
    'compressor',
    'widget_tweaks',
    'boscar'
] + get_core_apps(['boscar.catalogue'])

Migrations are automatically copied to my local app when I executed this command manage.py oscar_fork_app catalogue boscar.

My issue is when I execute the makemigrations command (python "manage.py makemigrations boscar"), it shows "No changes detected in app 'boscar'". But I already made a change to add is_active field in product table.

Upvotes: 1

Views: 337

Answers (1)

dentemm
dentemm

Reputation: 6379

I believe you need to refer to the catalogue app when migrating:

python manage.py makemigrations catalogue

Upvotes: 1

Related Questions