Skip to content
Snippets Groups Projects
Commit 6c84ad84 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

clear Taxonomy table before to open proteins

parent f7c8fd21
No related branches found
No related tags found
No related merge requests found
from django.core.management import BaseCommand from django.core.management import BaseCommand
import mysql.connector import mysql.connector
from ippidb.models import Bibliography, Protein
from ippidb.models import Bibliography, Protein, Taxonomy
class Command(BaseCommand): class Command(BaseCommand):
...@@ -48,6 +49,7 @@ class Command(BaseCommand): ...@@ -48,6 +49,7 @@ class Command(BaseCommand):
rows = cursor.fetchall() rows = cursor.fetchall()
Protein.objects.all().delete() Protein.objects.all().delete()
self.stdout.write(self.style.SUCCESS('Successfully flushed protein table')) self.stdout.write(self.style.SUCCESS('Successfully flushed protein table'))
Taxonomy.objects.all().delete()
for row in rows: for row in rows:
try: try:
p = Protein() p = Protein()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment