Hello,
Are there any tricks to getting the display value of a choice field to
work with prepopulated_fields slug creation in the admin?
<code>
class Team(Base):
MALE = 1
FEMALE = 2
GENDER_CHOICES = (
(MALE, u'Men'),
(FEMALE, u'Women'),
)
slug = models.SlugField(_(u'slug'), max_length=100, unique=True,
db_index=True)
gender = models.IntegerField(_(u'gender'), choices=GENDER_CHOICES)
class TeamAdmin(admin.ModelAdmin):
prepopulated_fields = {
'slug': (
'title',
'gender',
)
}
</code>
The above (kinda) works, but it returns:
oregon-1
oregon-2
I would prefer if it returned:
oregon-men
oregon-women
Is there anyway for me to use get_gender_display in the admin's
prepopulated_fields?
Thanks!
Micky
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.