59
Here some models:
class UserProfile(models.Model):
name = models.CharField(max_length=30)
email = models.EmailField(unique=True, db_index=True)
birthday = models.DateField()
class Photo(models.Model):
user = models.ForeignKey(UserProfile)
description = models.TextField(blank=True)
photo = models.ImageField(upload_to='img/photo')
Let's say a user has 10 photos (10 objects of Photo model). When user deletes himself will all those 10 Photo database rows delete themselves automatically? (I've read docs, but English is not my native language, so I didn't understand everything about the on_delete attribute.)