SQLAlchemy ORM – Textual SQL Earlier, textual SQL using text() function has been explained from the perspective of core expression language of SQLAlchemy. Now we shall discuss it from ORM point of view. Literal strings can be used flexibly with Query object by specifying their use with the text() construct. Most applicable methods accept it. […]
Category Archives: sqlalchemy
SQLAlchemy ORM – Building Relationship This session describes creation of another table which is related to already existing one in our database. The customers table contains master data of customers. We now need to create invoices table which may have any number of invoices belonging to a customer. This is a case of one to […]
Working with Related Objects In this chapter, we will focus on the related objects in SQLAlchemy ORM. Now when we create a Customer object, a blank invoice collection will be present in the form of Python List. c1 = Customer(name = “Gopal Krishna”, address = “Bank Street Hydarebad”, email = “gk@gmail.com”) The invoices attribute of […]