Default value for hidden field in Django model
- by Daniel Garcia
I have this Model:
class Occurrence(models.Model):
id = models.AutoField(primary_key=True, null=True)
reference = models.IntegerField(null=True, editable=False)
def save(self):
self.collection = self.id
super(Occurrence, self).save()
I want for the reference field to be hidden and at the same time have the same value…