Skip to content

Commit

Permalink
adding support for export in legacy db schema [for the old tinydb]
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyBRoswell committed Dec 4, 2024
1 parent ee76a66 commit b373e4a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.core.management import CommandParser
from django.core.management.base import BaseCommand, CommandError
from catalog.models import Cell
from catalog.serializers import CellSerializer


class Command(BaseCommand):
help = 'Export designated tables in legacy db schema'
Expand All @@ -14,6 +16,8 @@ def handle(self, *args, **options):
match table:
case 'Cell':
queryset = Cell.objects.all()
print(queryset)
for cell in queryset:
serializer = CellSerializer(cell)
print(serializer.data)
case _:
raise CommandError(f"Table {table} is not supported")

0 comments on commit b373e4a

Please sign in to comment.