Add django-admin export and import commands, making dump-data and loaddata django-scopes compatible
This commit is contained in:
parent
b3bbb0b156
commit
1679d820a7
8
cookbook/management/commands/export.py
Normal file
8
cookbook/management/commands/export.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from django.core.management.commands.dumpdata import Command as DumpdataCommand
|
||||||
|
from django_scopes import scopes_disabled
|
||||||
|
|
||||||
|
|
||||||
|
class Command(DumpdataCommand):
|
||||||
|
def handle(self, *args, **options):
|
||||||
|
with scopes_disabled():
|
||||||
|
return super().handle(*args, **options)
|
8
cookbook/management/commands/import.py
Normal file
8
cookbook/management/commands/import.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
from django.core.management.commands.loaddata import Command as LoaddataCommand
|
||||||
|
from django_scopes import scopes_disabled
|
||||||
|
|
||||||
|
|
||||||
|
class Command(LoaddataCommand):
|
||||||
|
def handle(self, *args, **options):
|
||||||
|
with scopes_disabled():
|
||||||
|
return super().handle(*args, **options)
|
Loading…
Reference in New Issue
Block a user