forked from TDTP/admin_transporte_backend
fix procesa zip
parent
90d4d9d223
commit
046fd431a9
|
@ -8,7 +8,6 @@ import csv
|
|||
import zipfile
|
||||
import tempfile
|
||||
import threading
|
||||
import datetime
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Procesa los archivos gtfs en formato comprimido (zip)'
|
||||
|
@ -16,14 +15,13 @@ class Command(BaseCommand):
|
|||
def handle(self, *args, **options):
|
||||
# Lógica de tu comando aquí
|
||||
folder = config('GTFS_UPLOADS','/tmp')
|
||||
fecha_hoy = timezone.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
|
||||
redes = RedTransporte.objects.filter(vigente=True)
|
||||
for red in redes:
|
||||
self.stdout.write(self.style.SUCCESS(f'nombre red: {red.nombre_red}'))
|
||||
|
||||
gtfs_archivo = GtfsArchivo.objects \
|
||||
.filter(vigente=False, id_red = red.id_red, status = 'PENDIENTE', created__gte = fecha_hoy) \
|
||||
.filter(vigente=False, id_red = red.id_red, status = 'PENDIENTE') \
|
||||
.order_by('-created') \
|
||||
.first()
|
||||
|
||||
|
|
Loading…
Reference in New Issue