Context.model#

relationalai
#Context.model

Returns the Model object for which the context was created.

Example#

#import relationalai as rai

model = rai.model("people")
Person = model.Type("Person")

with model.query() as select:
    person = Person()
    response = select(person.name)

# 'response' is a 'Context' object created by 'model.query()'.
print(response.model == model)
# Output:
# True

Calling a ContextSelect object, like select in the preceding query, returns its Context object. In this case, response is the Context object created by model.query() in the with statement.

See Also#