﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30666	Use autocomplete_fields with models not registered in the admin	Germano Gabbianelli	nobody	"I think we should add the possibility to use `autocomplete_fields` with models not registered in the admin.

For a simple use case consider that I might be attempting to customize the default `UserAdmin`, by replacing all the `filter_horizontal` fields with `autocomplete_fields`:


{{{
from django.contrib.auth.admin import admin, User, UserAdmin

admin.site.unregister(User)

@admin.register(User)
class UserAdmin(UserAdmin):
    filter_horizontal = ()
    autocomplete_fields = (""groups"", ""user_permissions"")
}}}



This works for `groups`, because by default `Group` is registered in the admin, but won't work for `user_permissions` giving the following error:
{{{
<class 'djfoo.admin.UserAdmin'>: (admin.E039) An admin for model ""Permission"" has to be registered to be referenced by UserAdmin.autocomplete_fields.
}}}

In this specific case I don't want to register `Permission` with the admin, but I think I should be able to use different UI widgets for ManyToMany fields interchangeably.
"	New feature	closed	contrib.admin	2.2	Normal	wontfix			Unreviewed	0	0	0	0	0	0
