Is there a way to automatically set field values for models in Django when defining the model? This could be used for storing something like a timestamp (for example), but also for creating a field which is constructed as some function of the others.
In other words, I'm looking for something like this:
class Foo(models.Model):
spam = models.CharField(max_length=2000)
my_other_field = ###?
def generate_my_other_field():
#Some algorithm to determine the value of my_other_field