Skip to content

Instantly share code, notes, and snippets.

@Akshat1903
Created December 4, 2020 08:38
Show Gist options
  • Select an option

  • Save Akshat1903/f444c0bfe9bc59dbd79076a4be36eb65 to your computer and use it in GitHub Desktop.

Select an option

Save Akshat1903/f444c0bfe9bc59dbd79076a4be36eb65 to your computer and use it in GitHub Desktop.
from django.db import models
# Create your models here.
class FileUpload(models.Model):
file_name = models.CharField(max_length=250)
file = models.FileField(upload_to='files')
uploading_time = models.DateTimeField(auto_now=True)
def __str__(self):
return self.file_name
class Meta:
ordering = ['-uploading_time']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment