Re: content_object and comments

2010-08-16 Thread shacker
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

Re: content_object and comments

2010-08-16 Thread bruno desthuilliers
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

content_object and comments

2010-08-15 Thread shacker
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