def METHOD_NAME(context, instance):
    # Check if this user has already bookmarked the object
    content_type = ContentType.objects.get_for_model(instance)
    bookmark = Bookmark.objects.filter(
        object_type=content_type,
        object_id=instance.pk,
        user=context['request'].user
    ).first()
    # Compile form URL & data
    if bookmark:
        form_url = reverse('extras:bookmark_delete', kwargs={'pk': bookmark.pk})
        form_data = {
            'confirm': 'true',
        }
    else:
        form_url = reverse('extras:bookmark_add')
        form_data = {
            'object_type': content_type.pk,
            'object_id': instance.pk,
        }
    return {
        'bookmark': bookmark,
        'form_url': form_url,
        'form_data': form_data,
        'return_url': instance.get_absolute_url(),
    }