Skip to content
This repository was archived by the owner on Feb 22, 2026. It is now read-only.
This repository was archived by the owner on Feb 22, 2026. It is now read-only.

get_FOO_display #250

Description

@tapia

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions