Hi Folks,
I'm wondering are there any "parse_FOO_display" method for the django
models?
For example: {{{
class Transaction(models.Model):
STATUS = (
(1, 'Canceled_Reversal'),
(2, 'Completed'),
(3, 'Pending'),
(4, 'Refunded'),
(5, 'Reversed'),
(6, 'Processed'))
status = models.PositiveSmallIntegerField(choices=STATUS)
}}}
I know that I could call "tx.get_status_display()" to get descriptive
name for the status, say "Completed". But how can I get `2` when given
the descriptive name `Completed`?
Alex
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---