#31619: Incorrect error message get_object_or_404 if queryset have error
-----------------------------------------+------------------------
               Reporter:  dicos          |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  Uncategorized  |        Version:  3.0
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 {{{
 from django.db import models


 class Article(models.Model):
     title = models.CharField(_(u'title'), max_length=255)
     slug = models.SlugField(unique=True)


 class ArticleItem(models.Model):
     article = models.ForeignKey(Article, on_delete=models.CASCADE)
     text = models.TextField(_(u'text'), blank=True)


 from django.shortcuts import get_object_or_404

 qs = Article.objects.prefetch_related('qwe')
 get_object_or_404(qs), slug=slug)
 ValueError: First argument to get_object_or_404() must be a Model,
 Manager, or QuerySet, not 'QuerySet'.

 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31619>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.d3d7ff331e5f7c35bb5c4a6933e01f08%40djangoproject.com.

Reply via email to