models.py の整数であるオブジェクトを views.py に作成しようとしています。通常、models.py オブジェクトにはリストがありますが、この場合は単一の数値です。
def answer(request, level_id):
o = Level.objects.get(id=level_id)
correct = o.answers.filter(value__iexact=guess).exists() <--- working boolean function
points = o.points.get('points')
values = { 'score':points }
return render_to_response('game.html', values)
これによりエラーが発生します。
Int には get 属性がありません。
models.py からのポイント数を含む points 変数を作成しようとしています。
class Level(models.Model):
points = models.IntegerField("Point Value",default=1)