python - Variable referencing for an ndb.Model to be used in query -
i have following code in app:
query_string = booking.query()
which substitute booking
(an ndb.model
class) based on conditional logic.
i uncertain how create new booking
or other ndb.model
's query object "on fly".
my pseudo code:
my_query_object = ndb.model('booking').query()
is correct approach or can start generic ndb.model
query , specify type via text further along in query building process?
ok, happens, posting question prompts rtfm angel savior.
from docs here:
typically, application creates query calling model.query(). it's possible call ndb.query().
arguments
kind optional kind string. normally, name of entity class.
so solution code example becomes:
query_string = ndb.query(kind='booking')
Comments
Post a Comment