Вообщем я всетаки пофиксил для Django 1.5.0-alpha
Теперь это выглядит так:
In [1]: from users.models import User
In [2]: print User.objects.distinct('username').query
SELECT `auth_user`.`id`, `auth_user`.`username`, `auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`email`, `auth_user`.`password`, `auth_user`.`is_staff`, `auth_user`.`is_active`, `auth_user`.`is_superuser`, `auth_user`.`last_login`, `auth_user`.`date_joined` FROM `auth_user` GROUP BY `auth_user`.`username` ORDER BY NULL
In [3]: print User.objects.distinct('username', 'email').query
SELECT `auth_user`.`id`, `auth_user`.`username`, `auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`email`, `auth_user`.`password`, `auth_user`.`is_staff`, `auth_user`.`is_active`, `auth_user`.`is_superuser`, `auth_user`.`last_login`, `auth_user`.`date_joined` FROM `auth_user` GROUP BY `auth_user`.`username`, `auth_user`.`email` ORDER BY NULL
In [4]: print User.objects.distinct().query
SELECT DISTINCT `auth_user`.`id`, `auth_user`.`username`, `auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`email`, `auth_user`.`password`, `auth_user`.`is_staff`, `auth_user`.`is_active`, `auth_user`.`is_superuser`, `auth_user`.`last_login`, `auth_user`.`date_joined` FROM `auth_user`
Поддерживаются и lookups: filter(something__test__id=1)
In [6]: print CommentPlus.objects.filter(user=User.objects.get(pk=42), followup=True).distinct('object_pk', 'content_type__id').order_by().query
SELECT `django_comments`.`id`, `django_comments`.`content_type_id`, `django_comments`.`object_pk`, `django_comments`.`site_id`, `django_comments`.`user_id`, `django_comments`.`user_name`, `django_comments`.`user_email`, `django_comments`.`user_url`, `django_comments`.`comment`, `django_comments`.`submit_date`, `django_comments`.`ip_address`, `django_comments`.`is_public`, `django_comments`.`is_removed`, `comments_plus_commentplus`.`comment_ptr_id`, `comments_plus_commentplus`.`followup`, `comments_plus_commentplus`.`is_review`, `comments_plus_commentplus`.`review_type`, `comments_plus_commentplus`.`review_title` FROM `comments_plus_commentplus` INNER JOIN `django_comments` ON (`comments_plus_commentplus`.`comment_ptr_id` = `django_comments`.`id`) INNER JOIN `django_content_type` ON (`django_comments`.`content_type_id` = `django_content_type`.`id`) WHERE (`comments_plus_commentplus`.`followup` = True AND `django_comments`.`user_id` = 42 ) GROUP BY `django_comments`.`object_pk`, `django_comments`.`content_type_id` ORDER BY NULL
https://smappi.org/ - платформа по созданию API на все случаи жизни