Brand new file importer

This commit is contained in:
Eliot Berriot 2017-12-27 23:32:02 +01:00
parent 2e616282fd
commit 1c8f055490
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
16 changed files with 302 additions and 15 deletions

View file

@ -405,8 +405,11 @@ class ImportBatch(models.Model):
@property
def status(self):
pending = any([job.status == 'pending' for job in self.jobs.all()])
errored = any([job.status == 'errored' for job in self.jobs.all()])
if pending:
return 'pending'
if errored:
return 'errored'
return 'finished'
class ImportJob(models.Model):
@ -418,7 +421,7 @@ class ImportJob(models.Model):
null=True,
blank=True,
on_delete=models.CASCADE)
source = models.URLField()
source = models.CharField(max_length=500)
mbid = models.UUIDField(editable=False, null=True, blank=True)
STATUS_CHOICES = (
('pending', 'Pending'),