From 3b90437afcabe253650bb0cb2676374c0dc23b1c Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Tue, 16 Feb 2021 05:30:50 +0100 Subject: [PATCH] Fix slug not being editable Editable means also settable. I wanted it not to change after setting, but to no avail... --- wishlist/migrations/0002_auto_20210216_0430.py | 18 ++++++++++++++++++ wishlist/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 wishlist/migrations/0002_auto_20210216_0430.py diff --git a/wishlist/migrations/0002_auto_20210216_0430.py b/wishlist/migrations/0002_auto_20210216_0430.py new file mode 100644 index 0000000..a37204c --- /dev/null +++ b/wishlist/migrations/0002_auto_20210216_0430.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.6 on 2021-02-16 04:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('wishlist', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='wishlist', + name='slug', + field=models.SlugField(help_text="URL suffix for this wishlist. Must not clash existing ones, nor be 'user' nor 'item'.", primary_key=True, serialize=False), + ), + ] diff --git a/wishlist/models.py b/wishlist/models.py index d27a257..6d4c997 100644 --- a/wishlist/models.py +++ b/wishlist/models.py @@ -5,7 +5,7 @@ class WishList(models.Model): # Meta class? - slug = models.SlugField(max_length=50, blank=False, primary_key=True, editable=False, help_text="URL suffix for this wishlist. Must not clash existing ones, nor be 'user' nor 'item'.") + slug = models.SlugField(max_length=50, blank=False, primary_key=True, help_text="URL suffix for this wishlist. Must not clash existing ones, nor be 'user' nor 'item'.") name = models.TextField(help_text="The title of the wishlist.") description = models.TextField(blank=True, help_text="Optional (public) description of the wishlist.") owner = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, help_text="The user owning this wishlist.")