Hello
what am i doing wrong?
class MyModel(models.Model):
name = models.CharField(max_length=100, verbose_name=_("Name"), blank=False, null=False)
rating = models.DecimalField(max_digits=2, decimal_places=2, default=0)
id i do something like that:
average = count/len(votes)
mymodel.rating = average
mymodel.save()
count is the sum of all ratings of given MyModel and votes is array of those ratings, their division gives average rating for MyModel (sorry if i described it incorrectly due to my poor english)
if i change previous to:
mymodel.name = 'anything'
mymodel.save()
then 'anything' ends up in database, but rating does not.
why? am i using wrong field type?
Alan.