updated dataprepnodjango
This commit is contained in:
@@ -28,6 +28,8 @@ from django_countries.fields import CountryField
|
||||
from scipy.interpolate import splprep, splev, CubicSpline
|
||||
import numpy as np
|
||||
|
||||
import shutil
|
||||
|
||||
from django.conf import settings
|
||||
from sqlalchemy import create_engine
|
||||
import sqlalchemy as sa
|
||||
@@ -2805,6 +2807,12 @@ def auto_delete_file_on_delete(sender, instance, **kwargs):
|
||||
if instance.csvfilename+'.gz':
|
||||
if os.path.isfile(instance.csvfilename+'.gz'):
|
||||
os.remove(instance.csvfilename+'.gz')
|
||||
# remove parquet file
|
||||
try:
|
||||
dirname = 'media/strokedata_{id}.parquet.gz'.format(id=instance.id)
|
||||
shutil.rmtree(dirname)
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
@receiver(models.signals.post_delete,sender=Workout)
|
||||
def update_duplicates_on_delete(sender, instance, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user