From 5d21de48c774782217949c0b5dd997c96314c983 Mon Sep 17 00:00:00 2001 From: Eric Park Date: Fri, 9 Feb 2024 13:53:23 -0500 Subject: [PATCH] feat(server): add visible field to Device model Part of #346 --- server/core/migrations/0018_device_visible.py | 19 +++++++++++++++++++ server/core/models.py | 4 ++++ 2 files changed, 23 insertions(+) create mode 100644 server/core/migrations/0018_device_visible.py diff --git a/server/core/migrations/0018_device_visible.py b/server/core/migrations/0018_device_visible.py new file mode 100644 index 00000000..40ee0d81 --- /dev/null +++ b/server/core/migrations/0018_device_visible.py @@ -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" + ), + ), + ] diff --git a/server/core/models.py b/server/core/models.py index 3712d34b..9fc35e62 100644 --- a/server/core/models.py +++ b/server/core/models.py @@ -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)