It seems like django was designed to store data in databases. While writing my first app, I forgot about this and tried to set up a model like so:
class Team(models.Model):
stage = 0
users_score = {}
I soon realised that I could get this attribute but I couldn't set it:
team = Team()
team.stage = 1
team.save()
print Team.objects.get(pk=1).stage
This would print 0 when I expected 1. In my models file I change stage = 0
to
stage = models.IntegerField(default=0)
And it works as I want it to. Why can django get this attribute, but not set it? I'm guessing it's because the setattr() method has been changed. How can I verify this?