[Fixed]-How to get Character Value from an Integer database field

1👍

You’re probably looking for this: https://docs.djangoproject.com/en/dev/ref/models/instances/#django.db.models.Model.get_FOO_display

{{ object.get_field_display }}

0👍

As per my understanding you need to get selected option text when ever it will change or submitted right?, then you need to represent all options like this in a way so you will get whole object of option which is selected, then you can extract the value of even text from it.
Follow this:

<select  ng-model="selectOption" ng-change="changedValue(selectOption)" 
 data-ng-options="option as allOptions.name for option in allOptions">
<option value="">Select Account</option>

// Controller will be like this :

function ctrl($scope){
    $scope.itemList=[];
    $scope.allOptions=[{id:1,name:"a"},{id:2,name:"b"},{id:3,name:"c"}]

    $scope.changedValue=function(item){
    $scope.itemList.push(item.name);
    }    

}

Leave a comment