get_FOO_display
tapia opened this issue · comments
neo4django allows a choices
parameter when defining a property. With the Django model properties you can use that to show the choice value (documentation), but, AFAIK, you can't do that with neo4django.
I mean something like this:
class User(models.NodeModel):
GENDER_MALE = 1
GENDER_FEMALE = 2
GENDER_CHOICES = (
(GENDER_MALE, _(u"Male")),
(GENDER_FEMALE, _(u"Female")),
)
gender = models.IntegerProperty(choices=GENDER_CHOICES, default=GENDER_MALE)
This way we can build an internacionalized template using that field, while storing just an integer in our node:
<div class="gender">
{{ user.get_gender_display }}
</div>
Is there any way (or expected way) we can achieve this with neo4django?