user664546
user664546

Reputation: 5041

get entity from query object by keyname

I have a query object of artist.tracks

artist = db.ReferenceProperty(Artist,collection_name='tracks')

and I want to get the entity of the query object by its keyname so

artist.tracks = all tracks from artist

I want to get the track from this query with keyname of 'thisKeyName'

Upvotes: 2

Views: 245

Answers (1)

Robert Kluin
Robert Kluin

Reputation: 8292

If you know the key_name, you don't need a query use Model.get_by_key_name:

Kind.get_by_key_name('thisKeyName')

Upvotes: 2

Related Questions