When I edit a User in the admin, the sales_team and user_class
dropdowns are empty.

If anyone can point out my error or point me to the django core code
that ignores the choices, I would greatly appreciate it.

#models.py
SALES_TEAM_CHOICES = enumerate(('CLS','CCS','TPS'))
USER_CLASS_CHOICES = enumerate(('DOM','DSK','DFA','DTM'))

class UserProfile(models.Model):
    user = models.ForeignKey(User, unique=True)
    sales_team = models.IntegerField(choices=SALES_TEAM_CHOICES)
    user_class = models.IntegerField(choices=USER_CLASS_CHOICES)

#admin.py
class UserProfileInline(admin.StackedInline):
    model = UserProfile
    max_num = 1

class CustomUserAdmin(UserAdmin):
    inlines = [UserProfileInline,]

admin.site.unregister(User)
admin.site.register(User, CustomUserAdmin)



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

Reply via email to