from django.db import models from django.utils import timezone # Create your models here. class Video(models.Model): id = models.AutoField(primary_key=True) name = models.TextField() file = models.FileField(upload_to='videos/', null=True) thumbnail = models.FileField(upload_to='videos/', null=True) created_at = models.DateTimeField(default=timezone.now) class Meta: db_table = 'Video' def __str__(self): return str(self.id)