How to use sqlalchemy to connect to a pymysql database with two tables, extract the data and page it?

these are the data of my two tables:

clipboard.png

flask:

clipboard.png

sqlalchemy:

clipboard.png

:

clipboard.png


suppose models.py you designed it this way:

  sql to sqlalchemy Project  

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be77bf-31876.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be77bf-31876.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?