0

I have a site, where I want to run a code from an uploaded file from every 2 hours. So the user can upload many files and choose which one is the active. After the two hours, I check the database for 'active' files, and I want to import that file, and run a method from that file.

Here's the model, which stores the uploaded files:

class File(models.Model):
    name = models.CharField(max_length=32, blank=True)
    file = models.FileField(upload_to='myApp/files/uploaded_files')
    active = models.BooleanField()

How can I call a method from that file?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Nagy Vilmos
  • 1,878
  • 22
  • 46

0 Answers0