You should use instance.get_gender_display().
See http://www.djangoproject.com/documentation/models/choices/ for more
information...

I do believe this is more a question for django-users.
-- Gert

Mobile: +32 498725202
Web: http://gert.selentic.net


On Tue, Jan 12, 2010 at 12:38, 'chiru'tha <[email protected]> wrote:

> Hi every one..
>  i got a problem.. please help me..
>    I create a class for my model, in that class i declare an property
> gender and i make it as enum..
> it stores M or F only to the database. the sample code is shown
> bellow..
>
> GENDER_CHOICES = (
>        (u'M', u'Male'),
>        (u'F', u'Female'),
>    )
> class Player:
>     -----
>     gender = models.CharField(max_length=2, choices=GENDER_CHOICES,
> null=True, blank=True)
>      -----
>
>
> The problem is, i want to get the fields from data base , it returns
> only M or F.. but i want the real values that is  Male and Female..
> how to achieve this one.. please help me..
>
> thank you..
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-developers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-developers?hl=en.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups "Django developers" 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-developers?hl=en.

Reply via email to