-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding support for export in legacy db schema [for the old tinydb]
- Loading branch information
1 parent
66d570f
commit ee76a66
Showing
3 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
vreapis/catalog/management/commands/export_in_legacy_db_schema.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from django.core.management import CommandParser | ||
from django.core.management.base import BaseCommand, CommandError | ||
from catalog.models import Cell | ||
|
||
class Command(BaseCommand): | ||
help = 'Export designated tables in legacy db schema' | ||
|
||
|
||
def add_arguments(self, parser: CommandParser): | ||
parser.add_argument('tables', type=str, nargs='+', help='Tables to export') | ||
|
||
def handle(self, *args, **options): | ||
for table in options['tables']: | ||
match table: | ||
case 'Cell': | ||
queryset = Cell.objects.all() | ||
print(queryset) | ||
case _: | ||
raise CommandError(f"Table {table} is not supported") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters