Open tapia opened 10 years ago
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.
choices
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?
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:
This way we can build an internacionalized template using that field, while storing just an integer in our node:
Is there any way (or expected way) we can achieve this with neo4django?