mirror of
https://github.com/Hopiu/wagtail-modeltranslation.git
synced 2026-03-16 22:10:30 +00:00
Adds sub-module makemigrations to override django's 'makemigrations'
command New 'makemigrations' is a proxy for 'makemigrations_translation', it's role is only to override django's own command and skip any wagtailcore_page migrations caused by translation. Adding this to it's own submodule makes this override optional for the user. The original Django 'makemigrations' command is available by running 'makemigrations_original'
This commit is contained in:
parent
333c392dc8
commit
d3cb322c33
8 changed files with 22 additions and 1 deletions
|
|
@ -53,6 +53,7 @@ def runtests():
|
|||
'wagtail.contrib.settings',
|
||||
'wagtail.contrib.wagtailapi',
|
||||
|
||||
'wagtail_modeltranslation.makemigrations',
|
||||
'wagtail_modeltranslation',
|
||||
),
|
||||
# remove wagtailcore from serialization as translation columns have not been created at this point
|
||||
|
|
|
|||
3
wagtail_modeltranslation/makemigrations/__init__.py
Normal file
3
wagtail_modeltranslation/makemigrations/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# coding: utf-8
|
||||
|
||||
default_app_config = 'wagtail_modeltranslation.makemigrations.apps.MakemigrationsConfig'
|
||||
7
wagtail_modeltranslation/makemigrations/apps.py
Normal file
7
wagtail_modeltranslation/makemigrations/apps.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class MakemigrationsConfig(AppConfig):
|
||||
name = 'wagtail_modeltranslation.makemigrations'
|
||||
label = 'wagtail_modeltranslation_makemigrations'
|
||||
verbose_name = "Wagtail Modeltranslation makemigrations"
|
||||
0
wagtail_modeltranslation/makemigrations/management/commands/__init__.py
Executable file
0
wagtail_modeltranslation/makemigrations/management/commands/__init__.py
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
from wagtail_modeltranslation.management.commands.makemigrations_translation import Command as MakeMigrationsCommand
|
||||
|
||||
|
||||
class Command(MakeMigrationsCommand):
|
||||
pass
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
from django.core.management.commands.makemigrations import Command as MakeMigrationsCommand
|
||||
|
||||
|
||||
class Command(MakeMigrationsCommand):
|
||||
pass
|
||||
|
|
@ -88,7 +88,7 @@ class WagtailModeltranslationTransactionTestBase(TransactionTestCase):
|
|||
|
||||
# 5. makemigrations
|
||||
from django.db import connections, DEFAULT_DB_ALIAS
|
||||
call_command('makemigrations_translation', verbosity=2, interactive=False,
|
||||
call_command('makemigrations', verbosity=2, interactive=False,
|
||||
database=connections[DEFAULT_DB_ALIAS].alias)
|
||||
|
||||
# 6. Syncdb
|
||||
|
|
|
|||
Loading…
Reference in a new issue