title: Get Absolute URL in Django when using Class Based Views
body: <p>Hello I am migrating my app to use class based views instead of function based views. In my old code I was able to get the absolute URL of an object related to a function view this way:</p>
  
  <pre><code>class Category(models.Model):
      name = models.CharField(max_length=100,unique=True)
      slug = models.SlugField(unique=True)
      description = models.TextField()
      parent = models.ForeignKey('self',null=True,blank=True)
  
      def get_absolute_url(self):
          return reverse('blog.views.showcategory',args=[str(self.slug)])
  </code></pre>
  
  <p>I couldn't find what I should change in my get absolute url function in order to get the same result.</p>
  
  <p>This is my new class based view</p>
  
  <pre><code>class CategoryView(ListPosts):
      template_name = "postlist.html"
      context_object_name="posts"
      def get_queryset(self):
           return Post.objects.filter(category__slug=self.kwargs['slug']).order_by('created')
  </code></pre>
  
  <p>Thanks!</p>