title: Cannot resolve keyword u'slug' into field error in Django?
body: <p>I am getting the following error:</p>
  
  <pre><code>FieldError at /blog/1/first-post/
  
  Cannot resolve keyword u'slug' into field. Choices are: article, date, id, likes
  
  Request Method:     GET
  Request URL:    http://127.0.0.1:8000/blog/1/first-post/
  Django Version:     1.6.2
  Exception Type:     FieldError
  Exception Value:    
  
  Cannot resolve keyword u'slug' into field. Choices are: article, date, id, likes
  </code></pre>
  
  <p>My model:</p>
  
  <pre><code>class Article(models.Model):
      title = models.CharField(max_length=20)
      body = models.TextField()
      image = models.ImageField(upload_to="/", blank=True, null=True)
      slug = models.SlugField()
  
      def save(self, *args, **kwargs):
          if not self.id:
              self.slug = slugify(self.title)
          super(Article, self).save(*args, **kwargs)
  
      def get_absolute_url(self):
          return reverse('article_detail', kwargs={'slug':self.slug, 'id':self.id})
  
      def __unicode__(self):
          return self.title
  
  class Detail(models.Model):
      article = models.ForeignKey(Article)
      date = models.DateField()
      likes = models.IntegerField()
  
      def __unicode__(self):
          return "%s %s" % (self.article.title, self.likes)
  
      def get_absolute_url(self):
          return reverse('detail_article', kwargs={'id':self.id})
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>class ArticleDetail(DetailView):
       model = Detail
       template_name = "article_detail.html"
       context_object_name = "details"
  
       def get_queryset(self):
          print self.kwargs['slug']
          a = Article.objects.get(slug=self.kwargs['slug'])
          # print Details.object.get()
          # print Detail.objects.filter(article__slug=self.kwargs['slug']) fails with same error
          return Detail.objects.filter(article=a)
  </code></pre>
  
  <p>urls.py (this is inside by blog app):</p>
  
  <pre><code>urlpatterns = patterns('',
  
  url(r'all$', ArticleList.as_view(), name='blog_all'),
  url(r'^(?P&lt;id&gt;\d+)/(?P&lt;slug&gt;[-\w\d]+)/$', ArticleDetail.as_view(), name='article_detail'),
  url(r'^detail/?(P&lt;id?\d+)/$', DetailArticle.as_view(), name='detail_article'),
  url(r'^create$', ArticleCreateView.as_view(), name='blog_create'),
  )
  </code></pre>
  
  <p>Basically the detailView of an <code>article instance</code> will display the contents of <code>detail</code> model that has foreignkey relationship to <code>article model</code>. It is not the traditional way where the detail view of <code>article</code> instance displays that instance.</p>
  
  <p>Template here:</p>
  
  <pre><code>{% extends "base.html" %}
  {% block content %}
  {% for detail in details %}
  &lt;p&gt;{{ detail.article.title }}&lt;/p&gt;
  &lt;p&gt;{{ detail.date }}&lt;/p&gt;
  &lt;p&gt;{{ detail.likes }}&lt;/p&gt;
  {% endfor %}
  {% endblock %}
  </code></pre>