mirror of
https://github.com/Dadechin/Dashboard-XRoom.git
synced 2025-07-16 15:14:33 +00:00
added download api
This commit is contained in:
parent
efe7f27962
commit
0338751297
|
@ -1,19 +1,12 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
class Download(models.Model):
|
class Download(models.Model):
|
||||||
TYPE_CHOICES = [
|
|
||||||
('windows', 'Windows'),
|
|
||||||
('android', 'android'),
|
|
||||||
('linux', 'Linux'),
|
|
||||||
# Add more types as needed
|
|
||||||
]
|
|
||||||
|
|
||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
description = models.TextField(blank=True)
|
description = models.TextField(blank=True)
|
||||||
url = models.URLField()
|
url = models.URLField(blank=True) # Optional if file is used
|
||||||
version = models.CharField(max_length=50)
|
version = models.CharField(max_length=50)
|
||||||
type = models.CharField(max_length=50, choices=TYPE_CHOICES)
|
type = models.CharField(max_length=50)
|
||||||
|
file = models.FileField(upload_to='downloads/', blank=True, null=True)
|
||||||
created_at = models.DateTimeField(auto_now_add=True)
|
created_at = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user