S
S
Sama Samsonov2017-05-03 10:34:21
Django
Sama Samsonov, 2017-05-03 10:34:21

Slugfield how to use it correctly?

from django.db.models import permalink
class Tags(models.Model):
    slug = models.SlugField(max_length=100, unique=True)
    title = models.CharField(max_length=100, db_index=True)
    @permalink
    def get_absolute_url(self):
        return ('view_blog_tags', None, { 'slug': self.slug })

Is there a class in which the get_absolute_url method does not work?
Error in view_blog_tags what's wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question