fix: fetch db sqlite dengan aturan sort desc
This commit is contained in:
parent
a3837e9b1a
commit
fc04f6d220
2 changed files with 6 additions and 5 deletions
3
main.py
3
main.py
|
@ -9,7 +9,7 @@ from datetime import datetime
|
|||
import requests
|
||||
import telegram
|
||||
from dotenv import load_dotenv
|
||||
from sqlalchemy import update
|
||||
from sqlalchemy import desc, update
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
|
||||
from models import Notifikasi, Session
|
||||
|
@ -91,6 +91,7 @@ async def kirim_ke_tele():
|
|||
cek_data = (
|
||||
session.query(Notifikasi)
|
||||
.filter(Notifikasi.remark.like("%elu%"))
|
||||
.order_by(desc(Notifikasi.id))
|
||||
.limit(10)
|
||||
.all()
|
||||
)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
requests=2.32.3
|
||||
sqlalchemy=2.0.35
|
||||
python-telegram-bot=21.6
|
||||
python-dotenv=1.0.1
|
||||
requests==2.32.3
|
||||
sqlalchemy==2.0.35
|
||||
python-telegram-bot==21.6
|
||||
python-dotenv==1.0.1
|
||||
|
|
Loading…
Reference in a new issue