dimanche 27 mars 2016

Incrementing a value in Flask with peewee

I have been making an application with Flask and Peewee and I am trying to increment a value by one in the database using the update() function.

Here is the problem:

models.User.update(
        likes+=1
        ).execute()

This is not working and I simply get the error:

  File "app.py", line 171
   love+=1
     ^
  SyntaxError: invalid syntax

Thanks for any help.

Aucun commentaire:

Enregistrer un commentaire