Answer the question
In order to leave comments, you need to log in
Why doesn't a migration create a slug field in Django?
Hello everyone
, I have this model:
class Article(models.Model):
slug = models.SlugField(unique=True, max_length=80, verbose_name="URL для статьи в человеческом виде", help_text="kak-nayti-korm-dlya-sobaki"),
article_category = models.CharField(max_length=200, default=1, choices=ARTICLE_CATEGORY_CHOICES,
.....
class Meta:
verbose_name = 'Статья'
verbose_name_plural = 'Статьи'
def __str__(self):
return self.title
def get_absolute_url(self):
return self.slug
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question