Imagine there is a code:

for i in new['test']: if str(new1[1]['id']) != i.news_id: hy = new1[1]['text'] 

i.news_id is a row from the database. But you need to view the values ​​in the database from the end, how can this be done?

  • 2
    The base itself is able to sort the records. I don’t know how you work with the database, but in SQL, this uses ORDER BY . - Uladzimir Palekh
  • one
    Or ORDER BY DESC - Pavel Durmanov

0