Skip to content

Commit

Permalink
feat(server): add visible field to Device model
Browse files Browse the repository at this point in the history
Part of #346
  • Loading branch information
ericswpark committed Feb 9, 2024
1 parent c002a23 commit 5d21de4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
19 changes: 19 additions & 0 deletions server/core/migrations/0018_device_visible.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.2.7 on 2024-02-09 18:53

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("core", "0017_build_x86_type"),
]

operations = [
migrations.AddField(
model_name="device",
name="visible",
field=models.BooleanField(
default=True, help_text="Show device on the main downloads page"
),
),
]
4 changes: 4 additions & 0 deletions server/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def get_image_upload_path(self, filename):
)
created = models.DateTimeField(auto_now_add=True, editable=False)

visible = models.BooleanField(
default=True, help_text="Show device on the main downloads page"
)

def __str__(self):
return "{} {} ({})".format(self.manufacturer, self.name, self.codename)

Expand Down

0 comments on commit 5d21de4

Please sign in to comment.