Dashboard-XRoom/core/models/download.py

20 lines
744 B
Python
Raw Normal View History

2025-07-13 10:40:29 +00:00
from django.db import models
class Download(models.Model):
2025-07-14 07:01:42 +00:00
# Define choices as a tuple of tuples
TYPE_CHOICES = (
('android', 'Android'),
('windows', 'Windows'),
('metaquest', 'Meta Quest'),
)
2025-07-13 10:40:29 +00:00
name = models.CharField(max_length=255)
description = models.TextField(blank=True)
2025-07-13 10:51:59 +00:00
url = models.URLField(blank=True) # Optional if file is used
2025-07-13 10:40:29 +00:00
version = models.CharField(max_length=50)
2025-07-14 07:01:42 +00:00
type = models.CharField(max_length=50, choices=TYPE_CHOICES) # Updated with choices
2025-07-13 10:51:59 +00:00
file = models.FileField(upload_to='downloads/', blank=True, null=True)
2025-07-13 10:40:29 +00:00
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
2025-07-14 07:01:42 +00:00
return f"{self.name} ({self.type}) - v{self.version}"