from django.contrib import admin

from registration.models import RegistrationProfile


class RegistrationAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'activation_key_expired')
    search_fields = ('user__username', 'user__first_name')


admin.site.register(RegistrationProfile, RegistrationAdmin)

from django.contrib import admin

from registration.models import RegistrationProfile


class RegistrationAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'activation_key_expired')
    raw_id_fields = ['user']
    search_fields = ('user__username', 'user__first_name')


admin.site.register(RegistrationProfile, RegistrationAdmin)

Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users.
Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users.

  from django.contrib import admin
  
  from registration.models import RegistrationProfile
  
  
  class RegistrationAdmin(admin.ModelAdmin):
      list_display = ('__unicode__', 'activation_key_expired')
+     raw_id_fields = ['user']
      search_fields = ('user__username', 'user__first_name')
  
  
  admin.site.register(RegistrationProfile, RegistrationAdmin)
  
Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users.
## Code Before:
from django.contrib import admin

from registration.models import RegistrationProfile


class RegistrationAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'activation_key_expired')
    search_fields = ('user__username', 'user__first_name')


admin.site.register(RegistrationProfile, RegistrationAdmin)

## Instruction:
Use raw_id_fields for the relation from RegistrationProfile to User, for sites which have huge numbers of users.
## Code After:
from django.contrib import admin

from registration.models import RegistrationProfile


class RegistrationAdmin(admin.ModelAdmin):
    list_display = ('__unicode__', 'activation_key_expired')
    raw_id_fields = ['user']
    search_fields = ('user__username', 'user__first_name')


admin.site.register(RegistrationProfile, RegistrationAdmin)
