mirror of
https://github.com/Dadechin/Dashboard-XRoom.git
synced 2025-07-03 08:44:34 +00:00
12 lines
533 B
Python
12 lines
533 B
Python
from django.db import models
|
|
from django.conf import settings
|
|
|
|
class Video(models.Model):
|
|
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
|
|
url = models.URLField(max_length=250, blank=True) # For storing external URLs
|
|
video = models.FileField(upload_to='user_videos/', blank=True, null=True) # For file uploads
|
|
name = models.CharField(max_length=100)
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
|
|
def __str__(self):
|
|
return f"{self.name} - {self.user.username}" |