File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Generated by Django 5.2.8 on 2025-12-16 18:36
2+
3+ from django .db import migrations , models
4+
5+
6+ class Migration (migrations .Migration ):
7+
8+ dependencies = [
9+ ("versions" , "0025_version_versions_ve_active_ae486b_idx" ),
10+ ]
11+
12+ operations = [
13+ migrations .AlterField (
14+ model_name = "versionfile" ,
15+ name = "operating_system" ,
16+ field = models .CharField (
17+ choices = [
18+ ("Unix" , "Unix" ),
19+ ("Windows" , "Windows" ),
20+ ("Windows (Bin)" , "Windows (Bin)" ),
21+ ],
22+ default = "Unix" ,
23+ max_length = 15 ,
24+ ),
25+ ),
26+ ]
Original file line number Diff line number Diff line change @@ -212,19 +212,18 @@ def release_notes_cache_key(self):
212212 return f"release_notes_boost-{ version } "
213213
214214
215- class VersionFile (models .Model ):
216- Unix = "Unix"
217- Windows = "Windows"
218- OPERATING_SYSTEM_CHOICES = (
219- (Unix , "Unix" ),
220- (Windows , "Windows" ),
221- )
215+ class OperatingSystems (models .TextChoices ):
216+ UNIX = "Unix" , "Unix"
217+ WINDOWS = "Windows" , "Windows"
218+ WINDOWS_BIN = "Windows (Bin)" , "Windows (Bin)"
222219
220+
221+ class VersionFile (models .Model ):
223222 version = models .ForeignKey (
224223 Version , related_name = "downloads" , on_delete = models .CASCADE
225224 )
226225 operating_system = models .CharField (
227- choices = OPERATING_SYSTEM_CHOICES , max_length = 15 , default = Unix
226+ choices = OperatingSystems , max_length = 15 , default = OperatingSystems . UNIX
228227 )
229228 checksum = models .CharField (max_length = 64 , default = None )
230229 url = models .URLField ()
Original file line number Diff line number Diff line change 55
66from model_bakery import baker
77
8- from versions .models import VersionFile
8+ from versions .models import OperatingSystems
99
1010
1111def fake_checksum ():
@@ -152,7 +152,7 @@ def full_version_one(db):
152152 baker .make (
153153 "versions.VersionFile" ,
154154 version = v ,
155- operating_system = VersionFile . Unix ,
155+ operating_system = OperatingSystems . UNIX ,
156156 url = f1_url ,
157157 checksum = c1 ,
158158 )
@@ -162,7 +162,7 @@ def full_version_one(db):
162162 baker .make (
163163 "versions.VersionFile" ,
164164 version = v ,
165- operating_system = VersionFile . Unix ,
165+ operating_system = OperatingSystems . UNIX ,
166166 url = f2_url ,
167167 checksum = c2 ,
168168 )
@@ -172,7 +172,7 @@ def full_version_one(db):
172172 baker .make (
173173 "versions.VersionFile" ,
174174 version = v ,
175- operating_system = VersionFile . Windows ,
175+ operating_system = OperatingSystems . WINDOWS ,
176176 url = f3_url ,
177177 checksum = c3 ,
178178 )
You can’t perform that action at this time.
0 commit comments