Monday, January 16, 2012

admin - user related modules in admin

I use extended user profile (class name: UserProfile). I made an app for this, named account. In settings I have set:AUTH_PROFILE_MODULE = 'account.UserProfile'

But I made another model in that app named RestrictedUsername. I want to put there usernames, that will be reserved and not available in register process. I don't know why, but it doesn't appear in admin panel. I registered it:
from django.contrib import admin
from apps.account.models import RestrictedUsername
class RestrictedUsernameAdmin(admin.ModelAdmin):
list_display = ('username',)
search_fields = ('username',)
admin.site.register(RestrictedUsername, RestrictedUsernameAdmin)

Any ideas how to make it work?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/eUhARmLIvV4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate