feat: add client release size bytes

This commit is contained in:
QiuSW
2026-07-13 17:04:59 +08:00
parent 8878769ec5
commit b71564e2bf
13 changed files with 96 additions and 15 deletions
+8 -1
View File
@@ -1,5 +1,5 @@
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from django.core.validators import MinValueValidator, RegexValidator
from django.db import models, transaction
@@ -13,6 +13,13 @@ class DownloadRelease(models.Model):
version = models.CharField("版本", max_length=64)
file = models.FileField("安装包文件", upload_to="downloads/", blank=True)
external_url = models.URLField("外部下载地址", blank=True)
size_bytes = models.PositiveBigIntegerField(
"文件大小字节数",
null=True,
blank=True,
validators=[MinValueValidator(1)],
help_text="客户端下载文件大小,单位字节;桌面端用于下载后校验。",
)
sha256 = models.CharField(
"SHA256",
max_length=64,