LoginSignup
0
0

More than 3 years have passed since last update.

HTML DJANGOのデータベース更新

Posted at

このような形でvieww.pyからgoodの数をデータベースから引っ張ってきて数を+1させて表示させたいのですが、うまくできません。どこが間違っているのでしょうか、、。😭よろしくお願いいたします。

def good(self, pk):
    smart = Smart.objects.get(pk=pk)
    smart.good = smart.good + 1
    smart.save()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0