I have the following models
class Plant(ndb.Model):
name = ndb.StringProperty()
company = ndb.KeyProperty(kind='Company')
owner = ndb.KeyProperty(kind='User')
class RESTMeta:
user_owner_property = 'owner'
include_output_properties = ['name']
class Department(ndb.Model):
name = ndb.StringProperty()
plant = ndb.KeyProperty(kind='Plant')
owner = ndb.KeyProperty(kind='User')
class RESTMeta:
user_owner_property = 'owner'
include_output_properties = ['name']
Now in the GET request for department is working fine and the output is
/api/department
{
"next_results_url": null,
"results": [
{
"owner": null,
"plant": "aghzfnBnLWFwaXISCxIFUGxhbnQYgICAgIDyiAkM",
"name": "Packing",
"id": "aghzfnBnLWFwaXIXCxIKRGVwYXJ0bWVudBiAgICAmc6UCQw"
}
]
}
But how can i get the plant name instead of its Key