 <p>I found the problem. I did a migration and primary keys were changed because of this field photo = models.OneToOneField(Photo,primary_key=True,blank=True). The <code>primary_key=True</code> was messing with the professeur.id </p>