From 76fcefccf1906759b75917b1ff9daa4d0501e7ed Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Fri, 21 Aug 2020 12:33:03 +0200 Subject: [PATCH] Allow longer slugs --- articles/migrations/0018_auto_20200821_1232.py | 18 ++++++++++++++++++ articles/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 articles/migrations/0018_auto_20200821_1232.py diff --git a/articles/migrations/0018_auto_20200821_1232.py b/articles/migrations/0018_auto_20200821_1232.py new file mode 100644 index 0000000..067b2d6 --- /dev/null +++ b/articles/migrations/0018_auto_20200821_1232.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1 on 2020-08-21 10:32 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("articles", "0017_auto_20200820_1606"), + ] + + operations = [ + migrations.AlterField( + model_name="article", + name="slug", + field=models.SlugField(max_length=255, unique=True), + ), + ] diff --git a/articles/models.py b/articles/models.py index f0687cb..7bb903c 100644 --- a/articles/models.py +++ b/articles/models.py @@ -45,7 +45,7 @@ class Article(AdminUrlMixin, models.Model): updated_at = models.DateTimeField(auto_now=True) author = models.ForeignKey(User, on_delete=models.PROTECT, default=1) views_count = models.IntegerField(default=0) - slug = models.SlugField(unique=True) + slug = models.SlugField(unique=True, max_length=255) objects = ArticleManager() with_pages = models.Manager()