Reputation: 9429
Given a NDB Datastore (Google AppEngine) model definition:
class Customer(ndb.Model):
products = ndb.StructuredProperty(Product, repeated=True)
The model Customer defines a repeated sub-model, called Product. How can I get the name of the sub-model, in this case "Product"?
Upvotes: 0
Views: 124
Reputation: 3570
You can try:
getattr(Customer, 'products')._modelclass
Although if you use any method/properties prefixed with a _
you will be responsible for underlying API changes to the ndb library.
Upvotes: 2