File tree Expand file tree Collapse file tree 3 files changed +11
-19
lines changed Expand file tree Collapse file tree 3 files changed +11
-19
lines changed Original file line number Diff line number Diff line change 11from django .apps import AppConfig
2+ from django .db import models
3+ from django .db .migrations .operations import AlterModelOptions
4+
5+ from utilities .migration import custom_deconstruct
6+
7+ # Ignore verbose_name & verbose_name_plural Meta options when calculating model migrations
8+ AlterModelOptions .ALTER_OPTION_KEYS .remove ('verbose_name' )
9+ AlterModelOptions .ALTER_OPTION_KEYS .remove ('verbose_name_plural' )
10+
11+ # Use our custom destructor to ignore certain attributes when calculating field migrations
12+ models .Field .deconstruct = custom_deconstruct
213
314
415class CoreConfig (AppConfig ):
Original file line number Diff line number Diff line change 1- # noinspection PyUnresolvedReferences
21from django .conf import settings
32from django .core .management .base import CommandError
43from django .core .management .commands .makemigrations import Command as _Command
5- from django .db import models
6- from django .db .migrations .operations import AlterModelOptions
7-
8- from utilities .migration import custom_deconstruct
9-
10- # Monkey patch AlterModelOptions to ignore verbose name attributes
11- AlterModelOptions .ALTER_OPTION_KEYS .remove ('verbose_name' )
12- AlterModelOptions .ALTER_OPTION_KEYS .remove ('verbose_name_plural' )
13-
14- # Set our custom deconstructor for fields
15- models .Field .deconstruct = custom_deconstruct
164
175
186class Command (_Command ):
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments