E
E
Evstegney Chachlyk2019-07-05 23:13:48
Python
Evstegney Chachlyk, 2019-07-05 23:13:48

Why is the record in the database not being updated?

Bot for VK
receives a command from the dialogue

if args[0].isdigit() and args[1].isdigit():
                data = Global.select().where(Global.id == args[0])
                if bool(data):
                    data = list(data)[0]
                    data.metal += int(args[1])
                    data.save()

                # Global.update(
                #     metal=Global.metal + int(args[1])
                # ).where(Global.id == int(args[0])).execute()
                    return store.send('готово!')

I use the peewee module, I
try to update
, nothing works, I
tried in two ways
(the second in #)
and returns the line ID in the database
, no errors crashes

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question