title: Django 'function' object has no attribute 'objects'
body: <p>My apps allow you to like a picture  then it redirects you to the same page</p>
  
  <p>I get then error when I try to like a picture I can create a like objects with the shell prompt but why I get this error? thank for helping me</p>
  
  <pre><code>AttributeError at /like/3/
  function' object has no attribute 'objects'Request Method: GET 
  Request URL: http://127.0.0.1:8000/like/3/ 
  
  Exception Value: 'function' object has no attribute 'objects' 
  Traceback:
  File "C:\Python26\Lib\site-packages\django\core\handlers\base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
  File "C:\o\mysite\pet\views.py" in Like
  195.     new_like, created = Like.objects.get_or_create(user=request.user, picture_id=picture_id)
  </code></pre>
  
  <p>This is parts of my views.py</p>
  
  <pre><code>def Like(request,picture_id):
      pid = picture_id
      new_like, created = Like.objects.get_or_create(user=request.user, picture_id=picture_id)
      p = Picture.objects.get(pk=pid)
      if created:
          HttpResponseRedirect(reverse('world:url_name'))
      else:
          HttpResponseRedirect(reverse('world:url_name'))
  </code></pre>
  
  <p>My URLconf:</p>
  
  <pre><code>     url(
  </code></pre>
  
  <p>Parts of my model:
              r'^like/(?P\d+)/$',
              'pet.views.Like',
              name = 'Like'
          ),
  My boat.html</p>
  
  <pre><code> {% if picture %}
   &lt;ul&gt;
      {% for pet in picture %}
      &lt;li&gt;&lt;b&gt;description&lt;/b&gt; = {{ pet.description}}&lt;br/&gt;
          {% if pet.image %}
   &lt;li&gt;
      &lt;a href ="{% url world:Like pet.id %}"&gt;
          &lt;img src= "{{ pet.image.url }}" style="cursor:pointer"&gt;
      &lt;/a&gt;
   &lt;li&gt;
          {% endif %}
   {% endfor %}
   &lt;/ul&gt;
   {% endif %}
   &lt;a href="{% url world:PictureCreator %}"&gt;Add Pictures to your board&lt;/a&gt;&lt;br/&gt;
  </code></pre>
  
  <p>My models.py</p>
  
  <pre><code>class Picture(models.Model):
      user = models.ForeignKey(User)
      board = models.ForeignKey(Board,blank=False,null=False)
      image = models.FileField(upload_to="images/",blank=True)
      description = models.TextField()
      is_primary = models.BooleanField(default=False)
      def __unicode__(self):
          return self.description
  
  class Like(models.Model):
      user = models.ForeignKey(User)
      picture = models.ForeignKey(Picture)
      created = models.DateTimeField(auto_now_add=True)    
  </code></pre>