mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2025-12-24 02:39:20 -05:00
Add django-admin export and import commands, making dump-data and loaddata django-scopes compatible
This commit is contained in:
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)
|
||||||
Reference in New Issue
Block a user