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

reset MolecularFunction database before Protein import

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