When I change help_text or verbose_name for any of my model fields and run python manage.py makemigrations, it detects these changes a
I have written custom module for that purpose
All you need is to save it in some utils/models.db and in all your models instead of from django.db import models write from utils import models
If somebody is interested in it I can write a component and publish it on pypi
UPD: try this https://github.com/FeroxTL/django-migration-control
# models.py
# -*- coding: utf-8 -*-
from types import FunctionType
from django.db import models
class NoMigrateMixin(object):
"""
Позволяет исключить из миграций различные поля
"""
def deconstruct(self):
name, path, args, kwargs = super(NoMigrateMixin, self).deconstruct()
kwargs.pop('help_text', None)
kwargs.pop('verbose_name', None)
return name, path, args, kwargs
# =============================================================================
# DJANGO CLASSES
# =============================================================================
for name, cls in models.__dict__.items():
if isinstance(cls, type):
if issubclass(cls, models.Field):
# Поля
globals()[name] = type(name, (NoMigrateMixin, cls), {})
else:
# Всякие менеджеры
globals()[name] = cls
elif isinstance(cls, FunctionType):
# Прочие функции
globals()[name] = cls