From f3b7687f286696cd38900f9f1cab2ee1f5eaf56a Mon Sep 17 00:00:00 2001 From: Akrem <72977219+BarriBarri20@users.noreply.github.com> Date: Mon, 11 Sep 2023 21:02:53 +0100 Subject: [PATCH] fix typos in manually-constructing-a-slug.md (#59) --- antipattern/manually-constructing-a-slug.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/antipattern/manually-constructing-a-slug.md b/antipattern/manually-constructing-a-slug.md index 8529ed5..1c88ca0 100644 --- a/antipattern/manually-constructing-a-slug.md +++ b/antipattern/manually-constructing-a-slug.md @@ -56,15 +56,15 @@ following slugs: 'to-be-or-not-to-be' ``` -This thus means that this function will aim to create nice and valid slugs for the situations discussed above. -Usually it is better to work with utility functions that often cover "edge- and corner-cases" that indeed are not +This means that this function will aim to create nice and valid slugs for the situations discussed above. +Usually, it is better to work with utility functions that often cover "edge- and corner-cases" that indeed are not very common, but eventually if the number of blog posts will grow, some posts will have titles that can have invalid or ugly slug counterparts. Therefore it is in general better to work with a library that often deals with such cases in a better way. # Extra tips -Instead of creating a slug in a view, one can work with [**`dango-autoslug`** [readthedocs.io]](https://django-autoslug.readthedocs.io/en/latest/) +Instead of creating a slug in a view, one can work with [**`django-autoslug`** [readthedocs.io]](https://django-autoslug.readthedocs.io/en/latest/) and use an [**`AutoSlugField`** [readthedocs.io]](https://django-autoslug.readthedocs.io/en/latest/fields.html#autoslug.fields.AutoSlugField) to automatically populate a slug field based on another field. This makes the model more *declarative*, and this field has extra logic to preserve *uniqueness*.