Private
Public Access
1
0

updated dataprepnodjango

This commit is contained in:
Sander Roosendaal
2019-10-23 20:04:28 +02:00
parent fa373d781f
commit c0e8e448e3
3 changed files with 172 additions and 146 deletions

View File

@@ -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):