Home > Mobile >  I want to be able to search across 2 different models in flask_sqlachemy python
I want to be able to search across 2 different models in flask_sqlachemy python

Time:04-29

pic of my codeThis is what I have come up with so far but only the first function work I want to be able to combine both functions into a single function so that I can search both student and teacher models

CodePudding user response:

In a single function store the results of queries in two different list called
res1=Teacher.query()
res2=Student.query()

Then use,
result=res1 res2

  • Related