From 39757f64a75e018821e7bc30a39da58cb6751a8d Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Tue, 10 Oct 2023 12:29:43 +0200 Subject: [PATCH] updated links --- gawa/start/admin.py | 5 ++- .../migrations/0003_remove_link_status.py | 17 ++++++++++ ...k_date_remove_link_subtitle_de_and_more.py | 33 +++++++++++++++++++ gawa/start/models.py | 11 ++----- gawa/start/templates/start/links.html | 16 ++++----- gawa/start/views.py | 4 +-- 6 files changed, 65 insertions(+), 21 deletions(-) create mode 100644 gawa/start/migrations/0003_remove_link_status.py create mode 100644 gawa/start/migrations/0004_remove_link_date_remove_link_subtitle_de_and_more.py diff --git a/gawa/start/admin.py b/gawa/start/admin.py index a429314..15b5e57 100644 --- a/gawa/start/admin.py +++ b/gawa/start/admin.py @@ -24,7 +24,6 @@ class LinkAdmin(admin.ModelAdmin): """ Admin Interface for Links """ - list_display = ["title_en", "title_de", "url", - "suburl", "favicon", "status", "personal"] - ordering = ['status', 'title_de', 'title_en'] + list_display = ["title_en", "title_de", "url", "favicon", "personal"] + ordering = ['title_de', 'title_en'] actions = [regenerate] diff --git a/gawa/start/migrations/0003_remove_link_status.py b/gawa/start/migrations/0003_remove_link_status.py new file mode 100644 index 0000000..cd9e052 --- /dev/null +++ b/gawa/start/migrations/0003_remove_link_status.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.6 on 2023-10-10 10:09 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('start', '0002_initial'), + ] + + operations = [ + migrations.RemoveField( + model_name='link', + name='status', + ), + ] diff --git a/gawa/start/migrations/0004_remove_link_date_remove_link_subtitle_de_and_more.py b/gawa/start/migrations/0004_remove_link_date_remove_link_subtitle_de_and_more.py new file mode 100644 index 0000000..00aaa0f --- /dev/null +++ b/gawa/start/migrations/0004_remove_link_date_remove_link_subtitle_de_and_more.py @@ -0,0 +1,33 @@ +# Generated by Django 4.2.6 on 2023-10-10 10:10 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('start', '0003_remove_link_status'), + ] + + operations = [ + migrations.RemoveField( + model_name='link', + name='date', + ), + migrations.RemoveField( + model_name='link', + name='subtitle_de', + ), + migrations.RemoveField( + model_name='link', + name='subtitle_en', + ), + migrations.RemoveField( + model_name='link', + name='suburl', + ), + migrations.RemoveField( + model_name='link', + name='update', + ), + ] diff --git a/gawa/start/models.py b/gawa/start/models.py index 3652a09..6c82755 100644 --- a/gawa/start/models.py +++ b/gawa/start/models.py @@ -32,24 +32,19 @@ class Link(models.Model): contains all my interesting links """ + FAVICON_DIR: str = "img/links/favicons" + # the actual link url = models.URLField(unique=True, null=False, primary_key=True) - favicon_dir: str = "img/links/favicons" - favicon = models.ImageField(blank=True, upload_to=favicon_dir, null=True) - status = models.BooleanField(default=False) + favicon = models.ImageField(blank=True, upload_to=FAVICON_DIR, null=True) personal = models.BooleanField(default=False) title_de = models.CharField(max_length=50, default="Nicht übersetzt") title_en = models.CharField(max_length=50, default="Not translated") - subtitle_de = models.CharField(max_length=50, blank=True) - subtitle_en = models.CharField(max_length=50, blank=True) desc_de = models.TextField( blank=True, max_length=250, unique=False, default="Keine Beschreibung") desc_en = models.TextField( blank=True, max_length=250, unique=False, default="no description") - date = models.DateTimeField(blank=True, null=True) - update = models.DateTimeField(blank=True, null=True) keywords = models.ManyToManyField(Keyword, blank=True) - suburl = models.CharField(max_length=200, blank=True, null=True) public = models.BooleanField(default=False) def __str__(self): diff --git a/gawa/start/templates/start/links.html b/gawa/start/templates/start/links.html index 27da635..3baf467 100644 --- a/gawa/start/templates/start/links.html +++ b/gawa/start/templates/start/links.html @@ -11,17 +11,17 @@