How to update an integer field in a SQLite DB managed with Django models?
Extract of my Django models :
class Event(models.Model):
title = models.CharField(max_length=100)
[...]
attendees = models.ManyToManyField(Attendee)
max_attendees = 8
#max_attendees = models.PositiveSmallIntegerField(null=True, blank=True)
Testing with python3 manage.py shell
>>> from main.models import *
>>> Event.objects.first()
<Event: 8 places left>
>>> Event.objects.first().max_attendees
8
>>> Event.objects.first().max_attendees = 2
>>> Event.objects.first().save()
>>> Event.objects.first().max_attendees
8
As you can see, the value is not updated even with a save() on the "object".
I have also tried :
>>> Event.objects.first().max_attendees = models.PositiveSmallIntegerField(2)
But it's not updating the value of max_attendees either. How can I modify the value of this field?