[Django]-How to get values('content_object')?

2👍

content_object is GenericForeignKey field. You should speficy object_pk (fk_field) instead:

Comment.objects.values_list('id', 'object_pk')

UPDATE

To get comment ids, url for objects:

[(pk, urlresolvers.reverse('comments-url-redirect', args=(ct, o)))
 for pk, o, ct in Comment.objects.values_list('id', 'object_pk', 'content_type')]

Leave a comment