title: 'model' object has no attribute 'object' - error in Django?
body: <p>I get this error:
  <code>'Searches' object has no attribute 'object'</code>. I am using the <code>generic ListView</code> and I iterate over <code>object_list</code> in <code>template</code>. That is where the error comes in. My <code>view</code> is simple. Just attaching the <code>model</code>. All the relevant code is here.</p>
  
  <p>Thanks</p>
  
  <p>urlpatterns:</p>
  
  <pre><code>urlpatterns = patterns('',
                         url(r'^create/$','customsearches.views.create_search' , name='create_search'),
                         url(r'^list/$', SearchListView.as_view(template_name='search_list.html'), name='search_list'),
                         )
  </code></pre>
  
  <p>my model:</p>
  
  <pre><code>class Searches(models.Model):
      SELLER_CHOICES=(('OWNER','owner'),
                      ('DEALER','dealer'),
                      ('BOTH','both'), )
      #search_id = models.IntegerField(primary_key=True)
      user = models.ForeignKey(User)
      make = models.CharField(max_length=100, blank=True)
      model = models.CharField(max_length=100, blank=True)
      keywords = models.CharField(max_length=100, blank=True)
      max_price = models.IntegerField(blank=True, null=True)
      min_price = models.IntegerField(blank=True, null=True)
      max_year = models.IntegerField(blank=True, null=True)
      min_year = models.IntegerField(blank=True, null=True)
      pic_only = models.NullBooleanField()
      search_title_only = models.NullBooleanField()
      owner_dealer_all = models.CharField(max_length=10,choices=SELLER_CHOICES,verbose_name='owner/dealer')
      class Meta:
          #managed = False
          db_table = 'Searches'
          verbose_name_plural = "Searches"
  
      def __unicode__(self):
          return "%s %s %s-%s" %(self.make,self.model,self.max_year,self.min_year)
  
      def get_absolute_url(self):
          return reverse('postings.views.detail',args=[model_to_dict(self.object)])
  </code></pre>
  
  <p>view:</p>
  
  <pre><code>class SearchListView(ListView):
      model=Searches
  </code></pre>
  
  <p>template:</p>
  
  <pre><code>{% extends "base.html" %}
  {% block content %}
  
  {% for obj in object_list %}
  &lt;p&gt;&lt;a href="{{ obj.get_absolute_url }}"&gt;{{ obj }}&lt;/a&gt;&lt;/p&gt;
  {% endfor %}
  
  {% endblock %}
  </code></pre>