On Aug 16, 3:17 am, bruno desthuilliers
wrote:
>
> Of course. As the error message says, 'c' is here a queryset, not a
> model object. If you want to retrieve a single model object, you have
> to use manager.get, not manager.filter, ie:
Sorry about that brain fart - of course you're right - I jus
On 16 août, 08:14, shacker wrote:
> I'm trying to figure out why this works:
>
> >>> comments = Comment.objects.all()
> >>>[c.content_object for c in comments]
>
> [returns a list of the objects the comments are attached to]
>
> But this doesn't:
>
> >>> c = Comment.objects.filter(id=111)
> >>> c
I'm trying to figure out why this works:
>>> comments = Comment.objects.all()
>>>[c.content_object for c in comments]
[returns a list of the objects the comments are attached to]
But this doesn't:
>>> c = Comment.objects.filter(id=111)
>>> c
[]
>>> c.content_object
Traceback (most recent call l
3 matches
Mail list logo