I simply want to have a dropdown with country and save its code to neo4j as a string property. I am able to generate the drop down but it doesn't match what I want to achieve.
models.py
COUNTRY_CODE1=[("AF", 'Afghanistan'), ('BL', 'Albania'), ('DZ', 'Algeria')]
class Person(DjangoNode):
uid_person = UniqueIdProperty()
ind_name = StringProperty(max_length=100 , label='Enter your First Name',required=True)
ind_last_name = StringProperty(max_length=100,null=True, label='Last Name',required=True)
ind_nationality = StringProperty(max_length=2,choices=COUNTRY_CODE1,label='Nationality',required=True)
class Meta:
app_label = 'reg'
I simply want to have a dropdown with country and save its code to neo4j as a string property. I am able to generate the drop down but it doesn't match what I want to achieve.
models.py
forms.py
views.py
html template - using bootstrap4.
My output shows that for the choices appears like this.
I have two problems here . First one being the dropdown is incomplete I am assuming it should display
Second problem is that when I try to save it throws an error invalid choice with whatever option selected.
I am able to successfully save it without dropdown choices just the first two fields.