МС
Size: a a a
МС
МС
select url from table where status = 0 limits 1000
МС
AR
AR
AR
AR
МС
AR
МС
П
AR
AR
МС
def get_url_from_db():
records = CatalogModel().select().where(CatalogModel.status == 0).limit(1000)
items = []
with db_handle.atomic() as transaction:
for rec in records:
items.append({
'id': rec.id,
'str_id': rec.str_id,
'url': rec.url,
})
CatalogModel.update({'status': 1}).where(CatalogModel.id == rec.id).execute()
s = ''
transaction.commit()
return items
МС